unlock a semaphore
cc [options] -Kthread file
int sem_post(sem_t *sem);
sem_post increments the count
of the semaphore pointed to by sem,
and, if the new count value is less than or equal to zero,
makes the next thread waiting at the semaphore runnable.
If the semaphore value resulting from this operation is positive,
then no threads were blocked waiting for the semaphore to become
the semaphore value is simply incremented.
sem is a pointer to the semaphore to
increment and must previously have been initialized
The highest priority waiting thread
will be unblocked, and if there is more than one
highest priority thread blocked waiting for the
semaphore, then the highest priority thread that has been
waiting the longest will be unblocked.
sem_post is reentrant with respect to signals
and may be invoked from a signal-catching function.
sem_post returns zero on success.
Otherwise, it returns -1 and sets errno
to indicate the error.
sem_post returns -1 and sets errno to
the following values
if the corresponding conditions are detected:
invalid argument specified
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