12#ifndef NUMBER_OF_WORKERS
13#define NUMBER_OF_WORKERS 1
void lf_semaphore_destroy(lf_semaphore_t *semaphore)
Destroy the 'semaphore'.
void lf_semaphore_wait(lf_semaphore_t *semaphore)
Wait on the 'semaphore' if count is 0.
lf_semaphore_t * lf_semaphore_new(size_t count)
Create a new semaphore.
void lf_semaphore_acquire(lf_semaphore_t *semaphore)
Acquire the 'semaphore'.
void lf_semaphore_release(lf_semaphore_t *semaphore, size_t i)
Release the 'semaphore' and add 'i' to its count.
A semaphore.
Definition lf_semaphore.h:28
lf_cond_t cond
Condition variable used for blocking operations.
Definition lf_semaphore.h:48
lf_mutex_t mutex
Mutex used to protect access to the count.
Definition lf_semaphore.h:41
size_t count
The current count of the semaphore.
Definition lf_semaphore.h:34