.TH SLEEP_LOCK_SIG() "" "" "DDI/DKI Kernel Routine"
.PC "Acquire a sleep lock"
.B "#include <sys/ksynch.h>"
.B "#include <sys/types.h>"
\fBbool_t SLEEP_LOCK_SIG(\fIlock\^\fB, \fIpriority\^\fB)\fR
\fBsleep_t *\fIlock\^\fB; int \fIpriority\^\fB;\fR
.PP
.B SLEEP_LOCK_SIG()
acquires the sleep lock
.IR lock .
If
.I lock
is not available,
.B SLEEP_LOCK_SIG()
puts the caller to sleep;
when
.I lock
becomes available, it awakens the caller and returns a non-zero value.
The calling function can then return with the lock in its possession.
If
.I lock
is already held by the calling context, a deadlock occurs.
.PP
.I priority
gives the priority that the calling process wishes to have when it awakens.
For a list of legal values for this argument, see the entry for
.B SLEEP_LOCK()
in this manual.
.PP
Unlike the related function
.BR SLEEP_LOCK() ,
.B SLEEP_LOCK_SIG()
and its caller can be interrupted by a signal.
If
.B SLEEP_LOCK_SIG()
receives a signal (or if the caller receives a signal other than a
job-control-stop signal),
it immediately returns zero without waiting to acquire
.IR lock .
If, however, the caller receives a job-control-stop signal,
.B SLEEP_LOCK_SIG()
stops but restarts the lock operation as soon as the stop signal is released.
If all goes well,
.B SLEEP_LOCK_SIG()
returns a non-zero value.
.SH "See Also"
.B
DDI/DKI kernel routines,
signals
.R
.SH Notes
.B SLEEP_LOCK_SIG()
has base level only.
It can sleep.
.PP
A driver cannot hold a
driver-defined basic lock or read/write lock across a call to this function.
It can, however, hold a driver-defined sleep lock,
subject to the restriction described above.
