QP/C
Functions
qa_defer.c File Reference

QActive_defer() and QActive_recall() implementation. More...

#include "qf_pkg.h"
#include "qassert.h"

Go to the source code of this file.

Functions

void QActive_defer (QActive *const me, QEQueue *const eq, QEvt const *const e)
 Defer an event to a given separate event queue.
uint8_t QActive_recall (QActive *const me, QEQueue *const eq)
 Recall a deferred event from a given event queue.

Detailed Description

QActive_defer() and QActive_recall() implementation.

Definition in file qa_defer.c.


Function Documentation

void QActive_defer ( QActive *const  me,
QEQueue *const  eq,
QEvt const *const  e 
)

Defer an event to a given separate event queue.

This function is part of the event deferral support. An active object uses this function to defer an event e to the QF-supported native event queue eq. QF correctly accounts for another outstanding reference to the event and will not recycle the event at the end of the RTC step. Later, the active object might recall one event at a time from the event queue.

An active object can use multiple event queues to defer events of different kinds.

See also:
QActive_recall(), QEQueue

Definition at line 47 of file qa_defer.c.

References QEQueue_postFIFO().

uint8_t QActive_recall ( QActive *const  me,
QEQueue *const  eq 
)

Recall a deferred event from a given event queue.

This function is part of the event deferral support. An active object uses this function to recall a deferred event from a given QF event queue. Recalling an event means that it is removed from the deferred event queue eq and posted (LIFO) to the event queue of the active object.

QActive_recall() returns 1 (TRUE) if an event has been recalled. Otherwise the function returns 0.

An active object can use multiple event queues to defer events of different kinds.

See also:
QActive_recall(), QEQueue, QActive_postLIFO()

Definition at line 54 of file qa_defer.c.

References Q_ASSERT, QActive_postLIFO(), QEQueue_get(), QF_EVT_POOL_ID_, QF_EVT_REF_CTR_, and QF_EVT_REF_CTR_DEC_.