Releases the resource protected by the specified semaphore.
#include <synch.h> int sema_post ( sema_t *sp );
(IN) Points to the semaphore to signal.
Returns 0. If the sem parameter points to an invalid semaphore, the function does nothing and returns 0. If the sem parameter points to a valid semaphore, the function increments the semaphore value and returns 0.
The sem_post function increments the semaphore value. If a thread is waiting for the semaphore, it makes the blocked thread runnable. If multiple threads are blocked on the semaphore, no assumptions can be made about which of those threads might be unblocked.