![]() |
![]() |
![]() |
![]() |
Destroy a named semaphore
#include <semaphore.h> int sem_unlink( const char * sem_name );
libc
The sem_unlink() function destroys the named semaphore, sem_name. Open semaphores are removed the same way unlink() removes open files; the processes that have the semaphore open can still use it, but the semaphore will disappear as soon as the last process uses sem_close() to close it. Any attempt to sem_open() an unlinked semaphore will refer to a new semaphore.
Semaphores are persistent as long as the system remains up.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
The mqueue manager must be running for applications to use named semaphores.
sem_open(), sem_close(), sem_wait(), sem_trywait(), sem_post()
![]() |
![]() |
![]() |
![]() |