7 #ifndef PXR_BASE_WORK_WITH_SCOPED_PARALLELISM_H 8 #define PXR_BASE_WORK_WITH_SCOPED_PARALLELISM_H 13 #include "pxr/base/work/api.h" 15 #include "pxr/base/work/impl.h" 16 #include "pxr/base/tf/pyLock.h" 21 PXR_NAMESPACE_OPEN_SCOPE
102 PXR_WORK_IMPL_NAMESPACE_USING_DIRECTIVE;
105 TF_PY_ALLOW_THREADS_IN_SCOPE();
106 return WorkImpl_WithScopedParallelism(std::forward<Fn>(fn));
108 return WorkImpl_WithScopedParallelism(std::forward<Fn>(fn));
123 return std::forward<Fn>(fn)(dispatcher);
128 PXR_NAMESPACE_CLOSE_SCOPE
130 #endif // PXR_BASE_WORK_WITH_SCOPED_PARALLELISM_H
auto WorkWithScopedDispatcher(Fn &&fn, bool dropPythonGIL=true)
Similar to WorkWithScopedParallelism(), but pass a WorkDispatcher instance to fn for its use during t...
auto WorkWithScopedParallelism(Fn &&fn, bool dropPythonGIL=true)
Invoke fn, ensuring that all wait operations on concurrent constructs invoked by the calling thread o...