24#ifndef PXR_BASE_WORK_DETACHED_TASK_H
25#define PXR_BASE_WORK_DETACHED_TASK_H
31#include "pxr/base/work/api.h"
37PXR_NAMESPACE_OPEN_SCOPE
40struct Work_DetachedTask
42 explicit Work_DetachedTask(Fn &&fn) : _fn(
std::move(fn)) {}
43 explicit Work_DetachedTask(Fn
const &fn) : _fn(fn) {}
57void Work_EnsureDetachedTaskProgress();
64 using FnType =
typename std::remove_reference<Fn>::type;
65 Work_DetachedTask<FnType> task(std::forward<Fn>(fn));
67 Work_GetDetachedDispatcher().
Run(std::move(task));
68 Work_EnsureDetachedTaskProgress();
75PXR_NAMESPACE_CLOSE_SCOPE
Class used to record the end of the error-list.
bool Clear() const
Remove all errors in this mark from the error system.
A work dispatcher runs concurrent tasks.
void Run(Callable &&c, A1 &&a1, A2 &&a2,... AN &&aN)
Add work for the dispatcher to run.
void WorkRunDetachedTask(Fn &&fn)
Invoke fn asynchronously, discard any errors it produces, and provide no way to wait for it to comple...
WORK_API bool WorkHasConcurrency()
Return true if WorkGetPhysicalConcurrencyLimit() returns a number greater than 1 and PXR_WORK_THREAD_...