Xenomai
3.1
|
Functions | |
void | rtdm_sem_init (rtdm_sem_t *sem, unsigned long value) |
Initialise a semaphore More... | |
void | rtdm_sem_destroy (rtdm_sem_t *sem) |
Destroy a semaphore More... | |
int | rtdm_sem_down (rtdm_sem_t *sem) |
Decrement a semaphore More... | |
int | rtdm_sem_timeddown (rtdm_sem_t *sem, nanosecs_rel_t timeout, rtdm_toseq_t *timeout_seq) |
Decrement a semaphore with timeout More... | |
void | rtdm_sem_up (rtdm_sem_t *sem) |
Increment a semaphore More... | |
int | rtdm_sem_select (rtdm_sem_t *sem, rtdm_selector_t *selector, enum rtdm_selecttype type, unsigned int fd_index) |
Bind a selector to a semaphore More... | |
void rtdm_sem_destroy | ( | rtdm_sem_t * | sem | ) |
Destroy a semaphore
[in,out] | sem | Semaphore handle as returned by rtdm_sem_init() |
int rtdm_sem_down | ( | rtdm_sem_t * | sem | ) |
Decrement a semaphore
This is the light-weight version of rtdm_sem_timeddown(), implying an infinite timeout.
[in,out] | sem | Semaphore handle as returned by rtdm_sem_init() |
void rtdm_sem_init | ( | rtdm_sem_t * | sem, |
unsigned long | value | ||
) |
Initialise a semaphore
[in,out] | sem | Semaphore handle |
[in] | value | Initial value of the semaphore |
int rtdm_sem_select | ( | rtdm_sem_t * | sem, |
rtdm_selector_t * | selector, | ||
enum rtdm_selecttype | type, | ||
unsigned int | fd_index | ||
) |
Bind a selector to a semaphore
This functions binds the given selector to the semaphore so that the former is notified when the semaphore state changes. Typically the select binding handler will invoke this service.
[in,out] | sem | Semaphore handle as returned by rtdm_sem_init() |
[in,out] | selector | Selector as passed to the select binding handler |
[in] | type | Type of the bound event as passed to the select binding handler |
[in] | fd_index | File descriptor index as passed to the select binding handler |
int rtdm_sem_timeddown | ( | rtdm_sem_t * | sem, |
nanosecs_rel_t | timeout, | ||
rtdm_toseq_t * | timeout_seq | ||
) |
Decrement a semaphore with timeout
This function tries to decrement the given semphore's value if it is positive on entry. If not, the caller is blocked unless non-blocking operation was selected.
[in,out] | sem | Semaphore handle as returned by rtdm_sem_init() |
[in] | timeout | Relative timeout in nanoseconds, see RTDM_TIMEOUT_xxx for special values |
[in,out] | timeout_seq | Handle of a timeout sequence as returned by rtdm_toseq_init() or NULL |
void rtdm_sem_up | ( | rtdm_sem_t * | sem | ) |
Increment a semaphore
This function increments the given semphore's value, waking up a potential waiter which was blocked upon rtdm_sem_down().
[in,out] | sem | Semaphore handle as returned by rtdm_sem_init() |