37typedef struct semaphore {
44#define SEM_INITIALIZER(value) { 1, value }
Definitions for builtin attributes and compiler directives.
#define __depr(m)
Mark something as deprecated, with an informative message.
Definition cdefs.h:119
int sem_count(semaphore_t *sem)
Retrieve the number of available resources.
semaphore_t * sem_create(int value) __depr("Use sem_init or SEM_INITIALIZER.")
Allocate a new semaphore.
int sem_wait_timed(semaphore_t *sem, int timeout)
Wait on a semaphore (with a timeout).
int sem_wait(semaphore_t *sem)
Wait on a semaphore.
int sem_trywait(semaphore_t *sem)
"Wait" on a semaphore without blocking.
int sem_signal(semaphore_t *sem)
Signal a semaphore.
int sem_destroy(semaphore_t *sem)
Destroy a semaphore.
int sem_init(semaphore_t *sm, int count)
Initialize a semaphore for use.
Semaphore type.
Definition sem.h:37
int initialized
Are we initialized?
Definition sem.h:38
int count
The semaphore count.
Definition sem.h:39