SYNOPSIS
#include <semaphore.h>
int sem_destroy(sem_t *sem);
DESCRIPTION
The
Only semaphores on which no threads are currently blocked can be safely destroyed. Attempting to destroy a semaphore with currently blocked threads has undefined effects.
Attempting to destroy a named semaphore (that is, a semaphore created
by the
PARAMETERS
RETURN VALUES
When successful,
- EINVAL
-
The sem argument is not a valid semaphore.
- EBUSY
-
There are currently processes blocked on the semaphore.
EXAMPLES
None.
CONFORMANCE
UNIX 03. Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
AVAILABILITY
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
SEE ALSO
- Functions:
sem_init() ,sem_open() ,semctl() ,semget() ,semop()
- Miscellaneous:
- semaphores
PTC MKS Toolkit 10.4 Documentation Build 39.