.TH SLEEP_LOCKOWNED() "" "" "DDI/DKI Kernel Routine"
.PC "See if the caller holds a given sleep lock"
.B "#include <sys/ksynch.h>"
.B "#include <sys/types.h>"
\fBbool_t SLEEP_LOCKOWNED(\fIlock\^\fB)\fR
\fBsleep_t *\fIlock\^\fB;\fR
.PP
.B SLEEP_LOCKOWNED()
returns a non-zero value if the caller holds
the sleep lock
.IR lock .
It returns zero if the caller does not hold it.
You should use
.B SLEEP_LOCKOWNED()
only within an
.B ASSERT()
expression.
.SH "See Also"
.B
DDI/DKI kernel routines
.R
.SH Notes
.B SLEEP_LOCKOWNED()
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.
