1qwriter(9F)              Kernel Functions for Drivers              qwriter(9F)
2
3
4

NAME

6       qwriter - asynchronous STREAMS perimeter upgrade
7

SYNOPSIS

9       #include <sys/stream.h>
10       #include <sys/ddi.h>
11
12
13
14       void qwriter(queue_t *qp, mblk_t *mp, void (*func)(), int perimeter);
15
16

INTERFACE LEVEL

18       Solaris DDI specific (Solaris DDI).
19

PARAMETERS

21       qp            Pointer to the queue.
22
23
24       mp            Pointer  to a message that will be passed in to the call‐
25                     back function.
26
27
28       func          A function that will be called  when  exclusive  (writer)
29                     access has been acquired at the specified perimeter.
30
31
32       perimeter     Either PERIM_INNER or PERIM_OUTER.
33
34

DESCRIPTION

36       qwriter()  is  used  to  upgrade  the access at either the inner or the
37       outer perimeter from shared to exclusive and call the  specified  call‐
38       back  function  when the upgrade has succeeded. See mt-streams(9F). The
39       callback function is called as:
40
41         (*func)(queue_t *qp, mblk_t *mp);
42
43
44
45       qwriter() will acquire exclusive access  immediately  if  possible,  in
46       which  case  the  specified  callback  function will be executed before
47       qwriter() returns. If this is not possible, qwriter()  will  defer  the
48       upgrade  until  later  and return before the callback function has been
49       executed. Modules should not assume that the callback function has been
50       executed  when  qwriter() returns. One way to avoid dependencies on the
51       execution of the callback function is to immediately return after call‐
52       ing  qwriter()  and  let the callback function finish the processing of
53       the message.
54
55
56       When qwriter() defers calling the callback function, the STREAMS frame‐
57       work  will  prevent  other  messages  from entering the inner perimeter
58       associated with the queue until the upgrade has completed and the call‐
59       back function has finished executing.
60

CONTEXT

62       qwriter()  can  only  be  called from an put(9E) or srv(9E) routine, or
63       from a qwriter(), qtimeout(9F), or qbufcall(9F) callback function.
64

SEE ALSO

66       put(9E), srv(9E), mt-streams(9F), qbufcall(9F), qtimeout(9F)
67
68
69       STREAMS Programming Guide
70
71
72       Writing Device Drivers
73
74
75
76SunOS 5.11                        1 Mar 1993                       qwriter(9F)
Impressum