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