STREAMS-UX Programmer's Guide (February 2007)
STREAMS Utilities Supported by HP-UX
Appendix B
227
NAME
SV_WAIT_SIG () – Sleep on a synchronization variable.
SYNOPSIS
#include <sys/stream.h>
bool_t SV_WAIT_SIG(sv_t *svp, int priority, lock_t *lkp);
PARAMETERS
svp
Pointer to the synchronization variable on which to sleep.
priority
The priority value passed here is added to PZERO+1 and ORed with PCATCH. pridisk,
prinet, pritty, pritape, prihi, primed and prilo are defined to be 0 and do not affect the
caller’s priority. To change the process’s priority, study the priorities in
/usr/include/sys/param.h and pass the needed offset to PZERO+1 in the priority
parameter.
lkp
Pointer to a basic lock which must be locked when SV_WAIT_SIG is called. The basic lock is
released when the calling process goes to sleep.
DESCRIPTION
SV_WAIT_SIG() causes the calling process to sleep waiting for a call to SV_BROADCAST (D3) for the
synchronization variable specified by svp. SV_WAIT_SIG() may be interrupted by a signal, in which case it
returns early without waiting for a call to SV_BROADCAST().
The basic lock specified by lkp must be held by the caller upon entry. When SV_WAIT returns, the lkp spinlock
is not held and SV_WAIT lowers the priority level to the value before the caller acquired the lkp spinlock,
which may not be SPLNOPREEMPT. If the caller acquired the lock while holding other spinlocks, the priority
level is lowered to the value before the first of these nested spinlock calls.
RETURN VALUES
SV_WAIT_SIG() returns TRUE (a non-zero value) if the caller woke up because of a call to SV_BROADCAST().
SV_WAIT_SIG() returns FALSE (zero) if the caller woke up and returned early because of the sleep being
interrupted.
CONSTRAINTS
SV_WAIT_SIG() sleeps and can only be called from the thread context. Spinlocks (with the exception of the
lock specified in lkp) cannot be held across this call.