block on a synchronization variable
void SV_WAIT(sv_t *svp, int priority, lock_t *lkp);
SV_WAIT causes the calling process to block
(the caller's execution is suspended
and other processes may be scheduled)
waiting for a call to
for the synchronization
variable specified by svp.
Pointer to the synchronization variable on which to sleep.
A hint to the scheduling policy
as to the relative priority the caller wishes
to be assigned while running in the kernel
after waking up.
Pointer to a basic lock
which must be locked when SV_WAIT is called.
The basic lock is released when the calling process blocks,
as described below.
Valid values for priority are:
Priority appropriate for disk driver.
Priority appropriate for network driver.
Priority appropriate for terminal driver.
Priority appropriate for tape driver.
Drivers may use these values
to request a priority appropriate
to a given type of device
or to request a priority that is high, medium or low
relative to other activities within the kernel.
It is also permissible to specify
positive or negative offsets
from the values defined above.
Positive offsets result in more favorable priority.
The maximum allowable offset in all cases is 3
(that is, pridisk+3 and
pridisk-3 are valid values
but pridisk+4 and pridisk-4
are not valid).
Offsets can be useful in defining
the relative importance of different locks or resources
that may be held by a given driver.
In general, a higher relative priority
should be used when the caller is blocked
waiting for a highly contended kernel resource,
or when the caller is already holding
one or more locks or kernel resources
upon entry to SV_WAIT.
The exact semantic of the priority argument
is specific to the scheduling class of the caller,
and some scheduling classes may choose to ignore
the argument for the purposes of assigning a scheduling priority.
The basic lock specified by lkp
must be held by the caller upon entry.
The lock is released and the interrupt priority level is set
to plbase (block no interrupts)
after the process is queued on the synchronization variable
but prior to context switching to another process.
When the caller returns from SV_WAIT,
the basic lock is not held
and the interrupt priority level is equal to plbase.
The caller will not be interrupted by signals
while sleeping inside SV_WAIT.
must be able to tolerate premature wakeups.
After it is awakened (unblocked),
it must reexamine the condition
on which it was blocked.
Context and synchronization
User or blockable
3, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
``Synchronization variables'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005