Files | |
file | event.c |
This file is part of the RTAI project. | |
Functions | |
int | rt_event_create (RT_EVENT *event, const char *name, unsigned long ivalue, int mode) |
Create an event group. | |
int | rt_event_delete (RT_EVENT *event) |
Delete an event group. | |
int | rt_event_post (RT_EVENT *event, unsigned long mask) |
Post an event group. | |
int | rt_event_pend (RT_EVENT *event, unsigned long mask, unsigned long *mask_r, int mode, RTIME timeout) |
Pend on an event group. | |
int | rt_event_inquire (RT_EVENT *event, RT_EVENT_INFO *info) |
Inquire about an event group. |
|
Create an event group. Event groups provide for task synchronization by allowing a set of flags (or "events") to be waited for and posted atomically. An event group contains a mask of received events; any set of bits from the event mask can be pended or posted in a single operation. Tasks can wait for a conjunctive (AND) or disjunctive (OR) set of events to occur. A task pending on an event group in conjunctive mode is woken up as soon as all awaited events are set in the event mask. A task pending on an event group in disjunctive mode is woken up as soon as any awaited event is set in the event mask.
Context: This routine can be called on behalf of a task or from the initialization code. |
|
Delete an event group. Destroy an event group and release all the tasks currently pending on it. An event group exists in the system since rt_event_create() has been called to create it, so this service must be called in order to destroy it afterwards.
Side-effect: This routine calls the rescheduling procedure if tasks have been woken up as a result of the deletion. Context: This routine can always be called on behalf of a task, or from the initialization code. |
|
Inquire about an event group. Return various information about the status of a specified event group.
Context: This routine can be called on behalf of a task, interrupt context or from the initialization code. |
|
Pend on an event group. Pends for one or more events on the specified event group, either in conjunctive or disjunctive mode. If the specified set of bits is not set, the calling task is blocked. The task is not resumed until the request is fulfilled.
Side-effect: This routine calls the rescheduling procedure unless the request is immediately satisfied or timeout specifies a non-blocking operation. Context: This routine can be called on behalf of a task. It can also be called on behalf of an interrupt context or from the initialization code provided timeout is equal to RT_TIME_NONBLOCK.
|
|
Post an event group. Post a set of bits to the event mask. All tasks having their wait request fulfilled by the posted events are resumed. In the same move, the matched bits are automatically cleared from the event mask by this service.
Side-effect: This routine calls the rescheduling procedure if a task is woken up as a result of the operation. Context: This routine can be called on behalf of a task, interrupt context or from the initialization code. |