Defines | |
#define | L4SEMAPHORE_INITIALIZER(x) {(x), 0, NULL} |
Semaphore initializer, use this to initialize semaphores in nested structures. | |
#define | L4SEMAPHORE_INIT(x) ((l4semaphore_t)L4SEMAPHORE_INITIALIZER(x)) |
Semaphore value generator, use this to initialize plain semaphores. | |
#define | L4SEMAPHORE_LOCKED_INITIALIZER L4SEMAPHORE_INITIALIZER(0) |
Semaphore initializer, initial count 0 (semaphore locked). | |
#define | L4SEMAPHORE_LOCKED ((l4semaphore_t)L4SEMAPHORE_LOCKED_INITIALIZER) |
Locked semaphore value, initial count 0. | |
#define | L4SEMAPHORE_UNLOCKED_INITIALIZER L4SEMAPHORE_INITIALIZER(1) |
Semaphore initializer, initial count 1 (semaphore unlocked). | |
#define | L4SEMAPHORE_UNLOCKED ((l4semaphore_t)L4SEMAPHORE_UNLOCKED_INITIALIZER) |
Unlocked semaphore value, initial count 1. | |
Functions | |
L4_INLINE void | l4semaphore_down (l4semaphore_t *sem) |
Decrement semaphore counter, block if result is < 0. | |
L4_INLINE int | l4semaphore_down_timed (l4semaphore_t *sem, unsigned timeout) |
Decrement semaphore counter, block for a given time if result is < 0. | |
L4_INLINE int | l4semaphore_try_down (l4semaphore_t *sem) |
Decrement semaphore counter, do not wait if result is < 0. | |
L4_INLINE void | l4semaphore_up (l4semaphore_t *sem) |
Increment semaphore counter, wakeup next thread in wait queue. |
#define L4SEMAPHORE_INITIALIZER | ( | x | ) | {(x), 0, NULL} |
Semaphore initializer, use this to initialize semaphores in nested structures.
x | Initial value for semaphore counter |
Definition at line 73 of file semaphore.h.
#define L4SEMAPHORE_INIT | ( | x | ) | ((l4semaphore_t)L4SEMAPHORE_INITIALIZER(x)) |
Semaphore value generator, use this to initialize plain semaphores.
x | Initial value for semaphore counter |
Definition at line 80 of file semaphore.h.
#define L4SEMAPHORE_LOCKED_INITIALIZER L4SEMAPHORE_INITIALIZER(0) |
Semaphore initializer, initial count 0 (semaphore locked).
Definition at line 87 of file semaphore.h.
#define L4SEMAPHORE_LOCKED ((l4semaphore_t)L4SEMAPHORE_LOCKED_INITIALIZER) |
#define L4SEMAPHORE_UNLOCKED_INITIALIZER L4SEMAPHORE_INITIALIZER(1) |
Semaphore initializer, initial count 1 (semaphore unlocked).
Definition at line 101 of file semaphore.h.
#define L4SEMAPHORE_UNLOCKED ((l4semaphore_t)L4SEMAPHORE_UNLOCKED_INITIALIZER) |
L4_INLINE void l4semaphore_down | ( | l4semaphore_t * | sem | ) |
Decrement semaphore counter, block if result is < 0.
sem | Semaphore structure |
L4_INLINE int l4semaphore_down_timed | ( | l4semaphore_t * | sem, | |
unsigned | timeout | |||
) |
Decrement semaphore counter, block for a given time if result is < 0.
sem | Semaphore structure | |
timeout | Timeout (in ms), timeout must be positive |
Decrement semaphore counter by 1. If the result is < 0, l4semaphore_down_timed blocks for time ms and waits for the release of the semaphore.
L4_INLINE int l4semaphore_try_down | ( | l4semaphore_t * | sem | ) |
Decrement semaphore counter, do not wait if result is < 0.
sem | Semaphore structure |
L4_INLINE void l4semaphore_up | ( | l4semaphore_t * | sem | ) |
Increment semaphore counter, wakeup next thread in wait queue.
sem | Semaphore structure |