7#ifndef PXR_BASE_WORK_DETACHED_TASK_H
8#define PXR_BASE_WORK_DETACHED_TASK_H
14#include "pxr/base/work/api.h"
16#include "pxr/base/work/impl.h"
21PXR_NAMESPACE_OPEN_SCOPE
24struct Work_DetachedTask
26 explicit Work_DetachedTask(Fn &&fn) : _fn(
std::move(fn)) {}
27 explicit Work_DetachedTask(Fn
const &fn) : _fn(fn) {}
28 void operator()()
const {
42 using FnType =
typename std::remove_reference<Fn>::type;
43 Work_DetachedTask<FnType> task(std::forward<Fn>(fn));
45 PXR_WORK_IMPL_NAMESPACE_USING_DIRECTIVE;
46 WorkImpl_RunDetachedTask<Work_DetachedTask<FnType>>(std::move(task));
53PXR_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.
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_...