11 #ifndef __UT_TASKLIST_H_INCLUDED__
12 #define __UT_TASKLIST_H_INCLUDED__
20 #include <tbb/parallel_for.h>
21 #include <tbb/task_group.h>
22 #include <type_traits>
34 return myTasks.isEmpty();
44 template <
typename Body>
47 myTasks.emplace_back(std::forward<Body>(task));
55 for (
auto&& task : myTasks)
57 tg.run([parent, task]() {
68 for (
auto&& task : myTasks)
80 template <typename RANGE, typename BODY>
91 [range = std::forward<RANGE>(range), body = std::forward<BODY>(body)]()
100 #endif // __UT_TASKLIST_H_INCLUDED__
void spawnRootAndWait()
Spawn this task list as root tasks and wait.
static const UT_TaskScope * getCurrent()
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
void append(Body &&task)
Append a task.
static bool isThreadingEnabled()
#define SYS_DEPRECATED_REPLACE(__V__, __R__)
void UTparallelForAppendToTaskList(UT_TaskList &task_list, RANGE &&range, BODY &&body)
OIIO_UTIL_API void parallel_for(int32_t begin, int32_t end, function_view< void(int32_t)> task, paropt opt=0)
void clear()
Removes all tasks.
bool isEmpty() const
Returns true when number of tasks is non-zero.
void runSerial()
Run this task list in serial.