44 for(
auto it = nodeCache, itEnd = nodeCache+
m_nodeCacheSize; it!=itEnd; ++it) {
65 for(
auto it = nodeCache, itEnd = nodeCache+
m_nodeCacheSize; it!=itEnd; ++it) {
85 returnValue->
m_task = iTask;
89 returnValue->
m_next.store(returnValue,std::memory_order_relaxed);
97 iTask->increment_ref_count();
102 if(0==iTask->decrement_ref_count()) {
103 tbb::task::spawn(*iTask);
118 if(
nullptr == oldHead) {
151 if(0==
t->decrement_ref_count()){
152 tbb::task::spawn(*
t);
std::atomic< bool > m_waiting
void add(WaitingTask *)
Adds task to the waiting list.
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 dependentTaskFailed(std::exception_ptr iPtr)
Called if waited for task failed.
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
std::unique_ptr< WaitNode[]> m_nodeCache
std::exception_ptr m_exceptionPtr
WaitingTaskList(unsigned int iInitialSize=2)
Constructor.
unsigned int m_nodeCacheSize
WaitNode * nextNode() const
void setNextNode(WaitNode *iNext)
WaitNode * createNode(WaitingTask *iTask)