destroy an unnamed semaphore
cc [options] -Kthread file
int sem_destroy(sem_t *sem);
sem_destroy destroys the
semaphore pointed to by sem.
This includes invalidating sem
and freeing any associated dynamically allocated
Only a semaphore that was
previously initialized by
sem_init may be destroyed using
It is safe to destroy an initialized semaphore upon which
no threads are currently blocked.
The effect of destroying a semaphore upon
which other threads are currently
blocked is undefined.
sem_destroy returns zero on success.
Otherwise, a value of -1 is returned and errno
is set to indicate the error.
sem_destroy returns the following value if the
corresponding condition is detected:
The sem argument is not a valid semaphore.
There are currently threads blocked on
The Single UNIX Specification, Version 2; The Open Group.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004