2 .\" Copyright (c) 1993, Sun Microsystems, Inc., All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH QWRITER 9F "Mar 1, 1993"
8 qwriter \- asynchronous STREAMS perimeter upgrade
12 #include <sys/stream.h>
17 \fBvoid\fR \fBqwriter\fR(\fBqueue_t *\fR\fIqp\fR, \fBmblk_t *\fR\fImp\fR, \fBvoid (*\fR\fIfunc\fR)(), \fBint\fR \fIperimeter\fR);
23 Solaris DDI specific (Solaris DDI).
40 Pointer to a message that will be passed in to the callback function.
49 A function that will be called when exclusive (writer) access has been acquired
50 at the specified perimeter.
56 \fB\fIperimeter\fR \fR
59 Either \fBPERIM_INNER\fR or \fBPERIM_OUTER\fR.
65 \fBqwriter()\fR is used to upgrade the access at either the inner or the outer
66 perimeter from shared to exclusive and call the specified callback function
67 when the upgrade has succeeded. See \fBmt-streams\fR(9F). The callback function
72 \fB(*func)(queue_t *\fR\fIqp\fR\fB, mblk_t *\fR\fImp\fR\fB);\fR
78 \fBqwriter()\fR will acquire exclusive access immediately if possible, in which
79 case the specified callback function will be executed before \fBqwriter()\fR
80 returns. If this is not possible, \fBqwriter()\fR will defer the upgrade until
81 later and return before the callback function has been executed. Modules should
82 not assume that the callback function has been executed when \fBqwriter()\fR
83 returns. One way to avoid dependencies on the execution of the callback
84 function is to immediately return after calling \fBqwriter()\fR and let the
85 callback function finish the processing of the message.
88 When \fBqwriter()\fR defers calling the callback function, the STREAMS
89 framework will prevent other messages from entering the inner perimeter
90 associated with the queue until the upgrade has completed and the callback
91 function has finished executing.
95 \fBqwriter()\fR can only be called from an \fBput\fR(9E) or \fBsrv\fR(9E)
96 routine, or from a \fBqwriter()\fR, \fBqtimeout\fR(9F), or \fBqbufcall\fR(9F)
101 \fBput\fR(9E), \fBsrv\fR(9E), \fBmt-streams\fR(9F), \fBqbufcall\fR(9F),
105 \fISTREAMS Programming Guide\fR
108 \fIWriting Device Drivers\fR