QUE_next
2-348
C Interface
Syntax
elem = QUE_next(qelem);
Parameters
Ptr
qelem;
/* element in queue */
Return Value
Ptr
elem;
/* next element in queue */
Description
QUE_next returns elem which points to the element in the queue after
qelem.
The qelem parameter is a pointer to an existing element of the QUE. The
return value, elem, is a pointer to the next element in the QUE. Such
elements have a structure defined similarly to that in the example in the
QUE Module topic. The first field in the structure must be of type
QUE_Elem and is used as an internal pointer.
Since QUE queues are implemented as doubly linked lists with a dummy
node at the head, it is possible for QUE_next to return a pointer to the
queue itself. Be careful not to call QUE_remove(elem) in this case.
Note:
If the queue is shared by multiple tasks, or tasks and SWIs or HWIs,
QUE_next should be used in conjunction with some mutual exclusion
mechanism (for example, SEM_pend/SEM_post, TSK_disable/
TSK_enable).
See Also
QUE_get
QUE_insert
QUE_prev
QUE_remove
QUE_next
Return next element in queue (non-atomically)