Sun Java System Web Proxy Server 4.0.11 NSAPI Developer's Guide


The sem_tgrab function tests and requests exclusive use of a semaphore. Unlike the similar sem_grab function, if exclusive access is unavailable the caller is not blocked but receives a return value of -1. Use this function to ensure that only one server processor thread performs an action at a time.


#include <base/sem.h>
int sem_grab(SEMAPHORE id);



SEMAPHORE id is the unique identification number of the semaphore.

See Also

sem_grab, sem_init, sem_release, sem_terminate