.TH RW_TRYRDLOCK() "" "" "DDI/DKI Kernel Routine"
.PC "Try to acquire a read/write lock in read mode"
.B "#include <sys/ksynch.h>"
.B "#include <sys/types.h>"
\fBpl_t RW_TRYRDLOCK(\fIlock\^\fB, \fIpriority\^\fB)\fR
\fBrwlock_t *\fIlock\^\fB; pl_t \fIpriority\^\fB;\fR
.PP
.B RW_TRYRDLOCK()
sets the level of interrupt priority to
.I priority
and acquires
.I lock
in read mode.
.PP
If all goes well,
.B RW_TRYRDLOCK()
returns the previous level of interrupt priority.
Unlike the related function
.BR RW_RDLOCK() ,
this function does not wait for
.I lock
to become available; rather, if
.I lock
is not available, it fails and returns the value
.BR invpl .
.SH "See Also"
.B
DDI/DKI kernel routines
.R
.SH Notes
.B RW_TRYRDLOCK()
has base or interrupt level.
It does not sleep.
.PP
A driver can hold a
driver-defined basic lock, read/write lock, or sleep lock
across a call to this function.
.PP
You can call
.B RW_TRYRDLOCK()
acquire a lock in an order other than that defined by the lock hierarchy.
.PP
When this function is called from interrupt level,
.I priority
must not be below the level at which the interrupt handler is running.
