Specifications

D
evice Driver Programming
11-22
svp is a pointer to the synchronization variable to be broadcast signaled.
flags is a bit field for flags. No flags are currently defined for use in drivers, and the
flags argument must be set to 0.
The SV_BROADCAST routine has no return value.
Each LWP that wakes up needs to recheck the sleep condition in case some other LWP has
been awakened first and changed this condition.
An example of the code for the wake up is as follows:
s = LOCK(driver.lock, pldisk)
driver.state = READY;
UNLOCK(driver.lock, s);
SV_BROADCAST(driver.lock, 0);
SV_BROADCAST can be an expensive operation if a large number of LWPs are sleeping on
a synchronization variable. In the example above, although all of the sleeping LWPswake
up and check their sleep condition, only one proceeds while the others go back to sleep.
This can use a large amount of processor time. To avoid this problem, or in case you know
that only one LWP is sleeping on the synchronization variable, use the SV_SIGNAL routine
rather than the SV_BROADCAST routine.
If no LWP is sleeping on the synchronization variable when the SV_BROADCAST or
SV_SIGNAL routine is called, the routine returns without any bad side effects.
To deallocate a synchronization variable, using the SV_DEALLOC routine:
#include <sys/ksynch.h>
#include <sys/ddi.h>
void SV_DEALLOC(svp)
sv_t *svp;
where:
svp is a pointer to the synchronization variable to be deallocated.
The SV_DEALLOC routine has no return value.
For additional information on the synchronization variable interfaces, refer to the corre-
sponding system manuals pages.