sem_post - increment the count of a semaphore
#include <semaphore.h>
Callable from ISR.
If, prior to the call to sem_post(), the value of sem was 0, and other threads were blocked waiting for the semaphore, then one of them will be allowed to return successfully from its call to sem_wait(). The thread which has been waiting the longest is unblocked.
If, prior to the call to sem_post(), no other threads were blocked for the semaphore, then its value is incremented by one.
If successful, sem_post() returns 0, otherwise it returns -1, and sets errno to indicate the error condition.