1 #ifndef FWCore_Concurrency_SerialTaskQueue_h 2 #define FWCore_Concurrency_SerialTaskQueue_h 59 #include "tbb/concurrent_queue.h" 114 void push(
const T& iAction);
156 template<
typename T>
188 pTask->setQueue(
this);
194 tbb::empty_task* waitTask =
new (tbb::task::allocate_root()) tbb::empty_task;
195 waitTask->set_ref_count(2);
197 pTask->setQueue(
this);
204 pTask->setQueue(
this);
212 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.
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