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

sem_init

The sem_init function creates a semaphore with a specified name and unique identification number. Use this function to allocate a new semaphore that will be used with the functions sem_grab and sem_release. Call sem_init from an init class function to initialize a static or global variable that the other classes will later use.

Syntax

#include <base/sem.h>
SEMAPHORE sem_init(char *name, int number);

Returns

The constant SEM_ERROR if an error occurred.

Parameters

SEMAPHORE *name is the name for the requested semaphore. The file name of the semaphore should be a file accessible to the process.

int number is the unique identification number for the requested semaphore.

See Also

sem_grab, sem_release, sem_terminate