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