1 #ifndef FWCore_Concurrency_SerialTaskQueue_h 2 #define FWCore_Concurrency_SerialTaskQueue_h 59 #include "tbb/concurrent_queue.h" 112 void push(
const T& iAction);
154 template<
typename T>
186 pTask->setQueue(
this);
192 tbb::empty_task* waitTask =
new (tbb::task::allocate_root()) tbb::empty_task;
193 waitTask->set_ref_count(2);
195 pTask->setQueue(
this);
202 pTask->setQueue(
this);
210 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.
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