|
HDK
|
#include <UT_ThreadQueue.h>
Public Member Functions | |
| UT_ThreadQueue (exint maxcost=-1) | |
| A max cost of -1 will never block on adding items to the queue. More... | |
| ~UT_ThreadQueue () | |
| int | entries () const |
| Prohibit copying as I am not sure if lock semantics will work. More... | |
| bool | remove (T &item) |
| T | waitAndRemove () |
| Blocks until the item is ready. More... | |
| bool | waitAndRemoveMS (T &item, int64 timeout_ms) |
| void | waitForEmpty () |
| int | waitForQueueChange () |
| int | waitForQueueChangeMS (int64 timeout_ms) |
| void | append (const T &item, exint cost=0) |
| void | append (T &&item, exint cost=0) |
Designed to be templated on a POD.
Definition at line 29 of file UT_ThreadQueue.h.
|
inline |
A max cost of -1 will never block on adding items to the queue.
Definition at line 33 of file UT_ThreadQueue.h.
|
inline |
Definition at line 38 of file UT_ThreadQueue.h.
|
inline |
Adds the item to the queue. Will block if it the total cost would be exceeded by adding this to the queue. Zero cost never block, nor does a max cost of -1
Definition at line 144 of file UT_ThreadQueue.h.
|
inline |
Adds the item to the queue. Will block if it the total cost would be exceeded by adding this to the queue. Zero cost never block, nor does a max cost of -1
Definition at line 146 of file UT_ThreadQueue.h.
|
inline |
Prohibit copying as I am not sure if lock semantics will work.
Synchronized test for number of entries
Definition at line 44 of file UT_ThreadQueue.h.
|
inline |
Removes an item, returns false if failed to remove because the queue was empty.
Definition at line 53 of file UT_ThreadQueue.h.
|
inline |
Blocks until the item is ready.
Definition at line 69 of file UT_ThreadQueue.h.
|
inline |
Timed block until item is ready, returns false if timed out. Not guaranteed to wait the entire length of timeout_ms before returning failure.
Definition at line 84 of file UT_ThreadQueue.h.
|
inline |
Blocks until the queue is empty. May not still be empty, since someone could add after you reach empty!
Definition at line 103 of file UT_ThreadQueue.h.
|
inline |
Blocks until a queue change occurs, returns the new queue size. Returns zero immediately if queue is empty.
Definition at line 115 of file UT_ThreadQueue.h.
|
inline |
Blocks until a queue change occurs, returns the new queue size. Returns zero immediately if queue is empty.
Definition at line 128 of file UT_ThreadQueue.h.