valusema(D3X)valusema(D3X)NAMEvalusema - return the value associated with a semaphore
SYNOPSIS
#include "sys/types.h"
#include "sys/sema.h"
valusema (sema_t *semap);
DESCRIPTIONvalusema returns a snapshot of the semaphore value associated with the
semaphore pointed to by semap. Because it performs no work, valusema is
primarily used for assertions.
Because the semaphore value can change immediately after the call, you
cannot use valusema for conditional semaphore operations. For situations
where you need to do this, use cpsema(D3X) and cvsema(D3X).
To initialize a semaphore, call initnsema(D3X) or initnsema_mutex(D3X).
Return Values
The returned value of this function is the value of the semaphore pointed
to by the semap parameter. Of course, if you give this function a bogus
semaphore pointer, there is no telling what the function returns.
See Also
ASSERT(D3)
Page 1