.TH SLEEP_LOCKAVAIL() "" "" "DDI/DKI Kernel Routine"
.PC "Query whether a sleep lock is available"
.B "#include <sys/ksynch.h>"
.B "#include <sys/types.h>"
\fBbool_t SLEEP_LOCKAVAIL(\fIlock\^\fB)\fR
\fBsleep_t *\fIlock\^\fB;\fR
.PP
.B SLEEP_LOCKAVAIL()
returns a non-zero value if the sleep lock
.B lock
is available.
If it is not available,
it returns zero.
Note that the state of a lock can change rapidly:
the value
.B SLEEP_LOCKAVAIL()
returns may no longer be valid by the time the caller sees it.
.SH "See Also"
.B
DDI/DKI kernel routines
.B
.SH Notes
.B SLEEP_LOCKAVAIL()
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.
