Xenomai  3.0.5
Collaboration diagram for Event Services:

Functions

void rtdm_event_init (rtdm_event_t *event, unsigned long pending)
 Initialise an event. More...
 
void rtdm_event_destroy (rtdm_event_t *event)
 Destroy an event. More...
 
void rtdm_event_pulse (rtdm_event_t *event)
 Signal an event occurrence to currently listening waiters. More...
 
void rtdm_event_signal (rtdm_event_t *event)
 Signal an event occurrence. More...
 
int rtdm_event_wait (rtdm_event_t *event)
 Wait on event occurrence. More...
 
int rtdm_event_timedwait (rtdm_event_t *event, nanosecs_rel_t timeout, rtdm_toseq_t *timeout_seq)
 Wait on event occurrence with timeout. More...
 
void rtdm_event_clear (rtdm_event_t *event)
 Clear event state. More...
 
int rtdm_event_select (rtdm_event_t *event, rtdm_selector_t *selector, enum rtdm_selecttype type, unsigned int fd_index)
 Bind a selector to an event. More...
 

Detailed Description

Function Documentation

◆ rtdm_event_clear()

void rtdm_event_clear ( rtdm_event_t *  event)

Clear event state.

Parameters
[in,out]eventEvent handle as returned by rtdm_event_init()
Tags
unrestricted

Referenced by a4l_get_time().

◆ rtdm_event_destroy()

void rtdm_event_destroy ( rtdm_event_t *  event)

Destroy an event.

Parameters
[in,out]eventEvent handle as returned by rtdm_event_init()
Tags
task-unrestricted, might-switch

References XNRMID, and xnselect_destroy().

Referenced by a4l_get_time(), and udd_unregister_device().

◆ rtdm_event_init()

void rtdm_event_init ( rtdm_event_t *  event,
unsigned long  pending 
)

Initialise an event.

Parameters
[in,out]eventEvent handle
[in]pendingNon-zero if event shall be initialised as set, 0 otherwise
Tags
task-unrestricted

Referenced by a4l_get_time().

◆ rtdm_event_pulse()

void rtdm_event_pulse ( rtdm_event_t *  event)

Signal an event occurrence to currently listening waiters.

This function wakes up all current waiters of the given event, but it does not change the event state. Subsequently callers of rtdm_event_wait() or rtdm_event_timedwait() will therefore be blocked first.

Parameters
[in,out]eventEvent handle as returned by rtdm_event_init()
Tags
unrestricted, might-switch

◆ rtdm_event_select()

int rtdm_event_select ( rtdm_event_t *  event,
rtdm_selector_t *  selector,
enum rtdm_selecttype  type,
unsigned int  fd_index 
)

Bind a selector to an event.

This functions binds the given selector to an event so that the former is notified when the event state changes. Typically the select binding handler will invoke this service.

Parameters
[in,out]eventEvent handle as returned by rtdm_event_init()
[in,out]selectorSelector as passed to the select binding handler
[in]typeType of the bound event as passed to the select binding handler
[in]fd_indexFile descriptor index as passed to the select binding handler
Returns
0 on success, otherwise:
  • -ENOMEM is returned if there is insufficient memory to establish the dynamic binding.
  • -EINVAL is returned if type or fd_index are invalid.
Tags
task-unrestricted

◆ rtdm_event_signal()

void rtdm_event_signal ( rtdm_event_t *  event)

Signal an event occurrence.

This function sets the given event and wakes up all current waiters. If no waiter is presently registered, the next call to rtdm_event_wait() or rtdm_event_timedwait() will return immediately.

Parameters
[in,out]eventEvent handle as returned by rtdm_event_init()
Tags
unrestricted, might-switch

Referenced by a4l_get_time(), and udd_notify_event().

◆ rtdm_event_timedwait()

int rtdm_event_timedwait ( rtdm_event_t *  event,
nanosecs_rel_t  timeout,
rtdm_toseq_t *  timeout_seq 
)

Wait on event occurrence with timeout.

This function waits or tests for the occurence of the given event, taking the provided timeout into account. On successful return, the event is reset.

Parameters
[in,out]eventEvent handle as returned by rtdm_event_init()
[in]timeoutRelative timeout in nanoseconds, see RTDM_TIMEOUT_xxx for special values
[in,out]timeout_seqHandle of a timeout sequence as returned by rtdm_toseq_init() or NULL
Returns
0 on success, otherwise:
  • -ETIMEDOUT is returned if the if the request has not been satisfied within the specified amount of time.
  • -EINTR is returned if calling task has been unblock by a signal or explicitly via rtdm_task_unblock().
  • -EIDRM is returned if event has been destroyed.
  • -EPERM may be returned if an illegal invocation environment is detected.
  • -EWOULDBLOCK is returned if a negative timeout (i.e., non-blocking operation) has been specified.
Tags
primary-timed, might-switch

Referenced by a4l_get_time(), and rtdm_event_wait().

◆ rtdm_event_wait()

int rtdm_event_wait ( rtdm_event_t *  event)

Wait on event occurrence.

This is the light-weight version of rtdm_event_timedwait(), implying an infinite timeout.

Parameters
[in,out]eventEvent handle as returned by rtdm_event_init()
Returns
0 on success, otherwise:
  • -EINTR is returned if calling task has been unblock by a signal or explicitly via rtdm_task_unblock().
  • -EIDRM is returned if event has been destroyed.
  • -EPERM may be returned if an illegal invocation environment is detected.
Tags
primary-only, might-switch

References rtdm_event_timedwait().

Referenced by a4l_get_time().