25 enum class RunOneResult :
int {
31 enum class State :
int {
37 using SortingJobQueue =
45 ::ll::TypedStorage<1, 1, bool const> mAsync;
46 ::ll::TypedStorage<4, 4, ::Bedrock::Threading::OSThreadPriority> mPriority;
47 ::ll::TypedStorage<8, 16, ::std::optional<uint64>> mCoreAffinity;
48 ::ll::TypedStorage<4, 8, ::std::optional<int>> mIdealCore;
49 ::ll::TypedStorage<8, 32, ::std::string> mName;
50 ::ll::TypedStorage<1, 1, ::Core::Profile::ThreadFrameType> mFrameType;
51 ::ll::TypedStorage<8, 16, ::std::thread> mThread;
52 ::ll::TypedStorage<4, 4, ::std::thread::id> mWorkerThreadID;
53 ::ll::TypedStorage<4, 4, ::std::atomic<::BackgroundWorker::State>> mState;
54 ::ll::TypedStorage<8, 160, ::ResetEventObj> mResetEvent;
55 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mIdle;
56 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mIdleSinceTime;
57 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::BackgroundTaskBase>> mCurrentTask;
58 ::ll::TypedStorage<8, 8, ::WorkerPool&> mWorkerPool;
59 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mMaxSpinlockDuration;
60 ::ll::TypedStorage<8, 360, ::BackgroundTaskQueue> mTaskQueue;
64 static ::BackgroundWorker* getLocal() {
return gLocalWorkerMappingSingleton(); }
68 BackgroundWorker& operator=(BackgroundWorker
const&);
69 BackgroundWorker(BackgroundWorker
const&);
75 virtual ~BackgroundWorker() =
default;
77 virtual bool isAsync()
const ;
79 virtual bool canTaskRunAgain()
const ;
85 MCAPI BackgroundWorker(
86 ::std::string_view name,
87 ::Core::Profile::ThreadFrameType frameType,
90 ::std::optional<uint64>
const coreAffinity,
91 ::std::optional<int>
const idealCore,
97 MCAPI
void queue(::std::shared_ptr<::BackgroundTaskBase> task);
99 MCAPI
void requestStop(
bool wait);
107 MCAPI static ::BackgroundWorker*& gLocalWorkerMappingSingleton();
114 ::std::string_view name,
115 ::Core::Profile::ThreadFrameType frameType,
118 ::std::optional<uint64>
const coreAffinity,
119 ::std::optional<int>
const idealCore,
127 MCFOLD
bool $isAsync()
const;
129 MCAPI
bool $canTaskRunAgain()
const;
Definition ITaskExecutionContext.h:5