37 m_nodeCache{
new WaitNode[iInitialSize]},
38 m_nodeCacheSize{iInitialSize},
39 m_lastAssignedCacheIndex{0},
42 for(
auto it = m_nodeCache, itEnd = m_nodeCache+m_nodeCacheSize; it!=itEnd; ++it) {
103 returnValue->
m_task = iTask;
104 returnValue->
m_next = returnValue;
112 iTask->increment_ref_count();
114 if(0==iTask->decrement_ref_count()) {
115 tbb::task::spawn(*iTask);
158 if(0==
t->decrement_ref_count()){
159 tbb::task::spawn(*
t);
WaitNode * createNode(tbb::task *iTask)
std::atomic< bool > m_waiting
std::atomic< unsigned int > m_lastAssignedCacheIndex
std::atomic< WaitNode * > m_head
void reset()
Resets access to the resource so that added tasks will wait.
std::atomic< WaitNode * > m_next
void add(tbb::task *)
Adds task to the waiting list.
WaitingTaskList(unsigned int iInitialSize=2)
Constructor.
void doneWaiting()
Signals that the resource is now available and tasks should be spawned.
unsigned int m_nodeCacheSize
WaitNode * nextNode() const
void setNextNode(WaitNode *iNext)