Oracle iPlanet Web Proxy Server 4.0.14 NSAPI Developer's Guide

sem_tgrab

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.

Syntax

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

Returns

Parameters

SEMAPHORE id is the unique identification number of the semaphore.

See Also

sem_grab, sem_init, sem_release, sem_terminate