Skip to content

cf_sem_post

Category: multithreading
GitHub: cute_multithreading.h


Increments the semaphore's counter and wakes one thread if the counter becomes greater than zero.

CF_Result cf_sem_post(CF_Semaphore* semaphore);
Parameters Description
semaphore The semaphore.

Remarks

As other threads call cf_sem_try or cf_sem_wait they decrement the semaphore's counter. Eventually the counter will become zero, causing additional threads to wait (sleep). When the resources become available again, this function is used to wake one up.

CF_Semaphore
cf_make_sem
cf_destroy_sem
cf_sem_value
cf_sem_try
cf_sem_wait