Texas Instruments TMS320 User Manual page 198

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Queues
5.3.2
Other QUE Functions
Example 5-17. Using QUE Functions with Mutual Exclusion Elements
5-16
Unlike QUE_get and QUE_put, there are a number of QUE functions that do
not disable interrupts when updating the queue. These functions must be
used in conjunction with some mutual exclusion mechanism if the queues
being modified are shared by multiple threads.
QUE_dequeue and QUE_enqueue are equivalent to QUE_get and QUE_put
except that they do not disable interrupts when updating the queue.
QUE_head is used to return a pointer to the first element in the queue without
removing the element. QUE_next and QUE_prev are used to scan the
elements in the queue—QUE_next returns a pointer to the next element in
the queue and QUE_prev returns a pointer to the previous element in the
queue.
QUE_insert and QUE_remove are used to insert or remove an element from
an arbitrary point within the queue.
Ptr QUE_dequeue(queue)
QUE_Handle queue;
Void QUE_enqueue(queue, elem)
QUE_Handle queue;
Ptr
elem;
Ptr QUE_head(queue)
QUE_Handle queue;
Ptr QUE_next(qelem)
Ptr qelem;
Ptr QUE_prev(qelem)
Ptr qelem;
Void QUE_insert(qelem, elem)
Ptr qelem;
Ptr elem;
Void QUE_remove(qelem)
Ptr qelem;
Note:
Since QUE queues are implemented as doubly linked lists with a header
node, QUE_head, QUE_next, or QUE_prev may return a pointer to the
header node itself (for example, calling QUE_head on an empty queue). Be
careful not to call QUE_remove and remove this header node.

Advertisement

Table of Contents
loading

Table of Contents