Queues
5-16
5.3.2
Other QUE Functions
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.
Example 5-17.
Using QUE Functions with Mutual Exclusion Elements
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.
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;
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...