v1.5.0
Go to the documentation of this file.
45 void sem_init(semaphore_t *sem, int16_t initial_permits, int16_t max_permits);
74 void sem_reset(semaphore_t *sem, int16_t permits);
Definition: lock_core.h:53
bool sem_acquire_timeout_ms(semaphore_t *sem, uint32_t timeout_ms)
Acquire a permit from a semaphore, with timeout.
Definition: sem.c:33
void sem_init(semaphore_t *sem, int16_t initial_permits, int16_t max_permits)
Initialise a semaphore structure.
Definition: sem.c:10
recursive mutex instance
Definition: mutex.h:47
bool sem_acquire_timeout_us(semaphore_t *sem, uint32_t timeout_us)
Acquire a permit from a semaphore, with timeout.
Definition: sem.c:37
bool sem_release(semaphore_t *sem)
Release a permit on a semaphore.
Definition: sem.c:67
bool sem_try_acquire(semaphore_t *sem)
Attempt to acquire a permit from a semaphore without blocking.
Definition: sem.c:55
void sem_acquire_blocking(semaphore_t *sem)
Acquire a permit from the semaphore.
Definition: sem.c:21
void sem_reset(semaphore_t *sem, int16_t permits)
Reset semaphore to a specific number of available permits.
Definition: sem.c:80
bool sem_acquire_block_until(semaphore_t *sem, absolute_time_t until)
Wait to acquire a permit from a semaphore until a specific time.
Definition: sem.c:41
int sem_available(semaphore_t *sem)
Return number of available permits on the semaphore.
Definition: sem.c:17