3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/deps/core/container/MovePriorityQueue.h"
7#include "mc/deps/core/threading/BackgroundTaskBase.h"
8#include "mc/deps/core/threading/ITaskExecutionContext.h"
9#include "mc/deps/core/threading/SPSCQueue.h"
10#include "mc/deps/profiler/ThreadFrameType.h"
23 enum class RunOneResult :
int {
29 enum class State :
int {
58 BackgroundWorker& operator=(BackgroundWorker
const&);
59 BackgroundWorker(BackgroundWorker
const&);
65 virtual ~BackgroundWorker() ;
67 virtual bool isAsync()
const ;
69 virtual bool canTaskRunAgain()
const ;
76 ::std::string_view name,
77 ::Core::Profile::ThreadFrameType frameType,
80 ::std::optional<uint64> coreAffinity,
81 ::std::optional<int> idealCore,
103 MCNAPI
void queue(::std::shared_ptr<::BackgroundTaskBase> task);
130 ::std::string_view name,
131 ::Core::Profile::ThreadFrameType frameType,
134 ::std::optional<uint64> coreAffinity,
135 ::std::optional<int> idealCore,
Definition BackgroundTaskBase.h:16
MCAPI BackgroundWorker(::std::string_view name, ::Core::Profile::ThreadFrameType frameType, bool async, ::Bedrock::Threading::OSThreadPriority const &priority, ::std::optional< uint64 > coreAffinity, ::std::optional< int > idealCore, ::WorkerPool &workerPool)
MCAPI bool $isAsync() const
MCAPI::BackgroundWorker::RunOneResult _runOneTask(::RunTaskOptions const &options)
MCAPI void requestStop(bool wait)
MCAPI bool $canTaskRunAgain() const
static MCAPI ::BackgroundWorker *& gLocalWorkerMappingSingleton()
MCAPI::RunTaskOptions getRunOptions()
MCAPI void queue(::std::shared_ptr<::BackgroundTaskBase > task)
static MCAPI ::BackgroundWorker * getLocal()
MCAPI bool _processNextTask(::RunTaskOptions const &options)
static MCAPI void ** $vftable()
MCAPI void * $ctor(::std::string_view name, ::Core::Profile::ThreadFrameType frameType, bool async, ::Bedrock::Threading::OSThreadPriority const &priority, ::std::optional< uint64 > coreAffinity, ::std::optional< int > idealCore, ::WorkerPool &workerPool)
MCAPI void _doNoWorkDelay()
MCAPI ::std::shared_ptr<::BackgroundTaskBase > _tryPop(::WorkerPool &pool)
MCAPI uint64 getApproximateTaskCount() const
MCAPI void resortPriorityQueue()
MCAPI bool isIdle() const
MCAPI bool processTaskSync(::RunTaskOptions const &options)
MCAPI::std::thread::id getThreadId() const
Definition OSThreadPriority.h:7
Definition ITaskExecutionContext.h:5
Definition WorkerPool.h:20
Definition RunTaskOptions.h:5