int sem_init(sem_t *sem, int pshared, unsigned int value);
If you attempt to initialize a semaphore that has already been initialized, the original semaphore is overwritten by the newly initialized one.
You can only use sem itself to perform synchronization.
Referring to copies of sem in calls to
Specifies the semaphore to be initialized.
Is ignored. In other implementations, this argument specifies whether or not the newly initialized semaphore is shared between processes or between threads. A non-zero value means the semaphore is shared between processes; a value of zero means it is shared between threads. On the NuTCRACKER Platform, semaphores are always shared.
Specifies the value to assign to the newly initialized semaphore.
When successful, the
The process lacks the appropriate privileges to initialize the semaphore.
The specified semaphore already exists.
The value argument exceeds SEM_VALUE_MAX.
Too many semaphores are currently open in the system.
A resource required to initialize the semaphore has been exhausted, or the limit on semaphores (SEM_NSEMS_MAX) has been reached.
UNIX 03. Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.3 Documentation Build 39.