1 #ifndef FWCore_Concurrency_SerialTaskQueue_h 2 #define FWCore_Concurrency_SerialTaskQueue_h 60 #include "tbb/concurrent_queue.h" 122 void push(
const T& iAction);
164 template<
typename T>
196 pTask->setQueue(
this);
202 tbb::empty_task* waitTask =
new (tbb::task::allocate_root()) tbb::empty_task;
203 waitTask->set_ref_count(2);
205 pTask->setQueue(
this);
212 pTask->setQueue(
this);
220 template <
typename T>
const SerialTaskQueue & operator=(const SerialTaskQueue &)=delete
void setQueue(SerialTaskQueue *iQueue)
tbb::task * finishedTask()
void pushAndWait(const T &iAction)
synchronously pushes functor iAction into queue
std::atomic< unsigned long > m_pauseCount
QueuedTask(const T &iAction)
tbb::task * pushAndGetNextTask(TaskBase *)
void pushTask(TaskBase *)
bool resume()
Resumes processing if the queue was paused.
tbb::task * finishedTask()
bool isPaused() const
Checks to see if the queue has been paused.
SerialTaskQueue(SerialTaskQueue &&iOther)
tbb::task * execute() override
TaskBase * pickNextTask()
std::atomic< bool > m_taskChosen
void push(const T &iAction)
asynchronously pushes functor iAction into queue
SerialTaskQueue * m_queue
tbb::concurrent_queue< TaskBase * > m_tasks
bool pause()
Pauses processing of additional tasks from the queue.
tbb::task * pushAndGetNextTaskToRun(const T &iAction)
asynchronously pushes functor iAction into queue and finds next task to execute