24 #ifndef PXR_BASE_WORK_WITH_SCOPED_PARALLELISM_H
25 #define PXR_BASE_WORK_WITH_SCOPED_PARALLELISM_H
34 #include <tbb/task_arena.h>
116 WorkWithScopedParallelism(Fn &&fn,
bool dropPythonGIL=
true)
120 return tbb::this_task_arena::isolate(std::forward<Fn>(fn));
123 return tbb::this_task_arena::isolate(std::forward<Fn>(fn));
135 WorkWithScopedDispatcher(Fn &&fn,
bool dropPythonGIL=
true)
137 return WorkWithScopedParallelism([&fn]() {
139 return std::forward<Fn>(fn)(dispatcher);
146 #endif // PXR_BASE_WORK_WITH_SCOPED_PARALLELISM_H
#define TF_PY_ALLOW_THREADS_IN_SCOPE()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE