summaryrefslogtreecommitdiff
path: root/usr/src/man/man9f/qwriter.9f
blob: 7920cfa753ec10892a44713a3b58902700f2ba63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
'\" te
.\" Copyright (c) 1993, Sun Microsystems, Inc., All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH QWRITER 9F "Mar 1, 1993"
.SH NAME
qwriter \- asynchronous STREAMS perimeter upgrade
.SH SYNOPSIS
.LP
.nf
#include <sys/stream.h>
#include <sys/ddi.h>



\fBvoid\fR \fBqwriter\fR(\fBqueue_t *\fR\fIqp\fR, \fBmblk_t *\fR\fImp\fR, \fBvoid (*\fR\fIfunc\fR)(), \fBint\fR \fIperimeter\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
Solaris DDI specific (Solaris DDI).
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIqp\fR \fR
.ad
.RS 14n
Pointer to the queue.
.RE

.sp
.ne 2
.na
\fB\fImp\fR \fR
.ad
.RS 14n
Pointer to a message that will be passed in to the callback function.
.RE

.sp
.ne 2
.na
\fB\fIfunc\fR \fR
.ad
.RS 14n
A function that will be called when exclusive (writer) access has been acquired
at the specified perimeter.
.RE

.sp
.ne 2
.na
\fB\fIperimeter\fR \fR
.ad
.RS 14n
Either \fBPERIM_INNER\fR or \fBPERIM_OUTER\fR.
.RE

.SH DESCRIPTION
.sp
.LP
\fBqwriter()\fR is used to upgrade the access at either the inner or the outer
perimeter from shared to exclusive and call the specified callback function
when the upgrade has succeeded. See \fBmt-streams\fR(9F). The callback function
is called as:
.sp
.in +2
.nf
\fB(*func)(queue_t *\fR\fIqp\fR\fB, mblk_t *\fR\fImp\fR\fB);\fR
.fi
.in -2

.sp
.LP
\fBqwriter()\fR will acquire exclusive access immediately if possible, in which
case the specified callback function will be executed before \fBqwriter()\fR
returns. If this is not possible, \fBqwriter()\fR will defer the upgrade until
later and return before the callback function has been executed. Modules should
not assume that the callback function has been executed when \fBqwriter()\fR
returns. One way to avoid dependencies on the execution of the callback
function is to immediately return after calling \fBqwriter()\fR and let the
callback function finish the processing of the message.
.sp
.LP
When \fBqwriter()\fR defers calling the callback function, the STREAMS
framework will prevent other messages from entering the inner perimeter
associated with the queue until the upgrade has completed and the callback
function has finished executing.
.SH CONTEXT
.sp
.LP
\fBqwriter()\fR can only be called from an \fBput\fR(9E) or \fBsrv\fR(9E)
routine, or from a \fBqwriter()\fR, \fBqtimeout\fR(9F), or \fBqbufcall\fR(9F)
callback function.
.SH SEE ALSO
.sp
.LP
\fBput\fR(9E), \fBsrv\fR(9E), \fBmt-streams\fR(9F), \fBqbufcall\fR(9F),
\fBqtimeout\fR(9F)
.sp
.LP
\fISTREAMS Programming Guide\fR
.sp
.LP
\fIWriting Device Drivers\fR