|
QP/C
|
QActive_postFIFO() definition. More...
Go to the source code of this file.
Functions | |
| void | QActive_postFIFO (QActive *me, QEvent const *e, void const *sender) |
| Posts an event e directly to the event queue of the acitve object me using the First-In-First-Out (FIFO) policy. | |
QActive_postFIFO() definition.
Definition in file qa_fifo.c.
| void QActive_postFIFO | ( | QActive * | me, |
| QEvent const * | e, | ||
| void const * | sender | ||
| ) |
Posts an event e directly to the event queue of the acitve object me using the First-In-First-Out (FIFO) policy.
Direct event posting is the simplest asynchronous communication method available in QF. The following example illustrates how the Philo active object posts directly the HUNGRY event to the Table active object.
extern QActive *AO_Table; QState Philosopher_hungry(Philosopher *me, QEvent const *e) { TableEvt *pe; switch (e->sig) { case Q_ENTRY_SIG: { pe = Q_NEW(TableEvt, HUNGRY_SIG); /* dynamically allocate event */ pe->philNum = me->num; QActive_postFIFO(AO_Table, (QEvent *)pe); /* direct posting */ return Q_HANDLED(); } . . . } return Q_SUPER(&QHsm_top); }
Definition at line 46 of file qa_fifo.c.
References QActive::eQueue, Q_ASSERT, QACTIVE_EQUEUE_SIGNAL_, QF_EVT_POOL_ID_, QF_EVT_REF_CTR_, QF_EVT_REF_CTR_INC_, QF_PTR_AT_, QS_aoObj_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_EQC_, QS_OBJ_, QS_QF_ACTIVE_POST_FIFO, QS_TIME_, QS_U8_, and QEvent::sig.
1.7.6.1