27 #ifndef __semaphore_h__
28 #define __semaphore_h__
38 #ifdef CONF_SEMAPHORES
64 extern inline int sem_init(sem_t * sem,
int pshared,
unsigned int value)
101 const time_t abs_timeout);
152 #endif // CONF_SEMAPHORES
158 #endif // __semaphore_h__
Interface: Time-related data and types.
void atomic_inc(atomic_t *counter)
increment atomic counter without interruption.
int sem_wait(sem_t *sem)
Wait for semaphore (blocking)
int sem_destroy(sem_t *sem)
We're done with the semaphore, destroy it.
volatile unsigned char atomic_t
The data type that allows for atomic count operations.
atomic_t sem_t
the semaphore data-type
int sem_timedwait(sem_t *sem, const time_t abs_timeout)
Wait for semaphore (blocking with timeout).
int sem_getvalue(sem_t *sem, int *sval)
Get the semaphore value.
Interface: critical section management.
unsigned long time_t
time type
int sem_post(sem_t *sem)
Post a semaphore.
int sem_trywait(sem_t *sem)
Try a wait for semaphore (non-blocking)
int sem_init(sem_t *sem, int pshared, unsigned int value)
Initialize a semaphore.