13 #ifndef __UT_ThreadQueue__
14 #define __UT_ThreadQueue__
43 return myList.entries();
54 item = myList.popFirst();
56 myCurrentCost -= cost;
69 while (!
remove(result))
99 return myList.entries();
114 if (cost && myMaxCost >= 0 && (myCurrentCost > 0) && (myCurrentCost + cost > myMaxCost))
129 myCurrentCost += cost;
139 return !myList.entries();
bool isEmpty() const
Non-synchronized, do not call outside of the lock.
UT_ThreadQueue(exint maxcost=-1)
A max cost of -1 will never block on adding items to the queue.
void waitForTrigger(UT_Lock &lock)
void append(const T &item, exint cost=0)
T waitAndRemove()
Blocks until the item is ready.
int entries() const
Synchronized test for number of entries.