.TH RW_WRLOCK() "" "" "DDI/DKI Kernel Routine"
.PC "Acquire a read/write lock in write mode"
.B "#include <sys/ksynch.h>"
.B "#include <sys/types.h>"
\fBpl_t RW_WRLOCK(\fIlock\^\fB, \fIpriority\^\fB)\fR
\fBrwlock_t *\fIlock\^\fB; pl_t \fIpriority\^\fB;\fR
.PP
.B RW_WRLOCK()
sets interrupt priority to
.I priority
and acquires
.IR lock .
points.
If the lock is not available,
.B RW_WRLOCK()
waits until it becomes available in write mode.
.PP
When it acquires
.IR lock ,
.B RW_WRLOCK()
returns the previous level of interrupt priority.
.SH "See Also"
.B
DDI/DKI kernel routines
.R
.SH Notes
.B RW_WRLOCK()
has base or interrupt level.
.PP
A driver can hold a
driver-defined sleep lock across a call to this function.
It can also hold a driver-defined basic lock or read/write locks;
however, note that attempting to acquire a lock that is already held
by the calling context can trigger a deadlock.
To avoid deadlock,
the caller should honor the hiererarchy of locks.
.PP
When this function is called from interrupt level,
.I priority
cannot be less than that of the interrupt handler.
