25 #include <sys/cdefs.h>
43 #define SEM_INITIALIZER(value) { 1, value }
int sem_init(semaphore_t *sm, int count)
Initialize a semaphore for use.
int sem_count(semaphore_t *sem)
Retrieve the number of available resources.
int sem_signal(semaphore_t *sem)
Signal a semaphore.
int sem_trywait(semaphore_t *sem)
"Wait" on a semaphore without blocking.
int sem_destroy(semaphore_t *sem)
Destroy a semaphore.
struct semaphore semaphore_t
Semaphore type.
int initialized
Are we initialized?
Definition: sem.h:37
Semaphore type.
Definition: sem.h:36
int count
The semaphore count.
Definition: sem.h:38
int sem_wait(semaphore_t *sem)
Wait on a semaphore.
int sem_wait_timed(semaphore_t *sem, int timeout)
Wait on a semaphore (with a timeout).
semaphore_t * sem_create(int value) __attribute__((deprecated))
Allocate a new semaphore.