Motr
M0
|
Data Structures | |
struct | m0_semaphore |
Functions | |
M0_INTERNAL int | m0_semaphore_init (struct m0_semaphore *semaphore, unsigned value) |
M0_INTERNAL void | m0_semaphore_fini (struct m0_semaphore *semaphore) |
M0_INTERNAL void | m0_semaphore_down (struct m0_semaphore *semaphore) |
M0_INTERNAL bool | m0_semaphore_trydown (struct m0_semaphore *semaphore) |
M0_INTERNAL void | m0_semaphore_up (struct m0_semaphore *semaphore) |
M0_INTERNAL unsigned | m0_semaphore_value (struct m0_semaphore *semaphore) |
M0_INTERNAL bool | m0_semaphore_timeddown (struct m0_semaphore *semaphore, const m0_time_t abs_timeout) |
M0_INTERNAL void | m0_semaphore_drain (struct m0_semaphore *semaphore) |
Implementation of m0_semaphore on top of Linux struct semaphore.
Linux kernel semaphore.
Implementation of m0_semaphore on top of sem_t.
User space semaphore.
M0_INTERNAL void m0_semaphore_down | ( | struct m0_semaphore * | semaphore | ) |
Downs the semaphore (P-operation).
Definition at line 49 of file semaphore.c.
M0_INTERNAL void m0_semaphore_drain | ( | struct m0_semaphore * | semaphore | ) |
Brings down the semaphore to 0.
Definition at line 25 of file semaphore.c.
M0_INTERNAL void m0_semaphore_fini | ( | struct m0_semaphore * | semaphore | ) |
Definition at line 45 of file semaphore.c.
M0_INTERNAL int m0_semaphore_init | ( | struct m0_semaphore * | semaphore, |
unsigned | value | ||
) |
Definition at line 38 of file semaphore.c.
M0_INTERNAL bool m0_semaphore_timeddown | ( | struct m0_semaphore * | semaphore, |
const m0_time_t | abs_timeout | ||
) |
Downs the semaphore, blocking for not longer than the (absolute) timeout given.
abs_timeout | absolute time since Epoch (00:00:00, 1 January 1970) |
Definition at line 75 of file semaphore.c.
M0_INTERNAL bool m0_semaphore_trydown | ( | struct m0_semaphore * | semaphore | ) |
Tries to down a semaphore without blocking.
Returns true iff the P-operation succeeded without blocking.
Definition at line 60 of file semaphore.c.
M0_INTERNAL void m0_semaphore_up | ( | struct m0_semaphore * | semaphore | ) |
Ups the semaphore (V-operation).
Definition at line 65 of file semaphore.c.
M0_INTERNAL unsigned m0_semaphore_value | ( | struct m0_semaphore * | semaphore | ) |
Returns the number of times a P-operation could be executed without blocking.
Definition at line 70 of file semaphore.c.