1 #ifndef FWCore_Concurrency_SerialTaskQueue_h
2 #define FWCore_Concurrency_SerialTaskQueue_h
59 #include "oneapi/tbb/task_group.h"
60 #include "oneapi/tbb/concurrent_queue.h"
118 template <
typename T>
119 void push(oneapi::tbb::task_group&,
const T& iAction);
139 template <
typename T>
158 void spawn(TaskBase&);
161 oneapi::tbb::concurrent_queue<TaskBase*>
m_tasks;
172 template <
typename T>
TaskBase * pushAndGetNextTask(TaskBase *)
const SerialTaskQueue & operator=(const SerialTaskQueue &)=delete
std::atomic< unsigned long > m_pauseCount
void push(oneapi::tbb::task_group &, const T &iAction)
asynchronously pushes functor iAction into queue
void pushTask(TaskBase *)
bool resume()
Resumes processing if the queue was paused.
QueuedTask(oneapi::tbb::task_group &iGroup, const T &iAction)
TaskBase * finishedTask()
bool isPaused() const
Checks to see if the queue has been paused.
SerialTaskQueue(SerialTaskQueue &&iOther)
TaskBase * pickNextTask()
std::atomic< bool > m_taskChosen
oneapi::tbb::concurrent_queue< TaskBase * > m_tasks
oneapi::tbb::task_group * m_group
virtual ~TaskBase()=default
oneapi::tbb::task_group * group()
TaskBase(oneapi::tbb::task_group *iGroup)
bool pause()
Pauses processing of additional tasks from the queue.