LeviLamina
Loading...
Searching...
No Matches
WorkerPool.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/container/MovePriorityQueue.h"
7#include "mc/deps/core/threading/BackgroundTaskBase.h"
8#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
9#include "mc/platform/brstd/flat_set.h"
10
11// auto generated forward declare list
12// clang-format off
14class Scheduler;
15namespace Bedrock::Threading { class Mutex; }
16namespace Bedrock::Threading { class OSThreadPriority; }
17// clang-format on
18
19class WorkerPool : public ::Bedrock::EnableNonOwnerReferences {
20public:
21 // member variables
22 // NOLINTBEGIN
36 // NOLINTEND
37
38public:
39 // prevent constructor by default
40 WorkerPool& operator=(WorkerPool const&);
41 WorkerPool(WorkerPool const&);
42 WorkerPool();
43
44public:
45 // virtual functions
46 // NOLINTBEGIN
47 virtual ~WorkerPool() /*override*/;
48 // NOLINTEND
49
50public:
51 // member functions
52 // NOLINTBEGIN
53 MCNAPI WorkerPool(::std::string name, ::Scheduler& owner);
54
55 MCNAPI WorkerPool(
56 ::std::string name,
57 uint64 threadCount,
59 ::std::optional<uint64> coreAffinityMask,
60 bool suppressWorkerProfiling,
61 ::std::optional<int> idealCore
62 );
63
64 MCNAPI bool _checkPendingWork();
65
66 MCNAPI_C ::std::vector<::std::thread::id> getThreadIds() const;
67
68 MCNAPI void queue(::std::shared_ptr<::BackgroundTaskBase> task, bool queueImmediate);
69
70 MCNAPI ::std::shared_ptr<::BackgroundTaskBase> tryPop(int minPriority);
71 // NOLINTEND
72
73public:
74 // static functions
75 // NOLINTBEGIN
76 MCNAPI static void _registerPool(::WorkerPool& pool);
77
78 MCNAPI static void _unregisterPool(::WorkerPool& pool);
79 // NOLINTEND
80
81public:
82 // static variables
83 // NOLINTBEGIN
84 MCNAPI static ::brstd::flat_set<::WorkerPool*, ::std::less<::WorkerPool*>, ::std::vector<::WorkerPool*>>&
86
87 MCNAPI static ::Bedrock::Threading::Mutex& sAllPoolsMutex();
88 // NOLINTEND
89
90public:
91 // constructor thunks
92 // NOLINTBEGIN
93 MCNAPI void* $ctor(::std::string name, ::Scheduler& owner);
94
95 MCNAPI void* $ctor(
96 ::std::string name,
97 uint64 threadCount,
99 ::std::optional<uint64> coreAffinityMask,
100 bool suppressWorkerProfiling,
101 ::std::optional<int> idealCore
102 );
103 // NOLINTEND
104
105public:
106 // destructor thunk
107 // NOLINTBEGIN
108 MCNAPI void $dtor();
109 // NOLINTEND
110
111public:
112 // vftables
113 // NOLINTBEGIN
114 MCNAPI static void** $vftable();
115 // NOLINTEND
116};
Definition BackgroundTaskBase.h:13
Definition EnableNonOwnerReferences.h:7
Definition Mutex.h:10
Definition OSThreadPriority.h:7
Definition Scheduler.h:14
MCAPI void queue(::std::shared_ptr<::BackgroundTaskBase > task, bool queueImmediate)
MCAPI WorkerPool(::std::string name, ::Scheduler &owner)
static MCAPI void ** $vftable()
MCAPI ::std::shared_ptr<::BackgroundTaskBase > tryPop(int minPriority)
MCAPI void * $ctor(::std::string name, uint64 threadCount, ::Bedrock::Threading::OSThreadPriority const &priority, ::std::optional< uint64 > coreAffinityMask, bool suppressWorkerProfiling, ::std::optional< int > idealCore)
MCAPI WorkerPool(::std::string name, uint64 threadCount, ::Bedrock::Threading::OSThreadPriority const &priority, ::std::optional< uint64 > coreAffinityMask, bool suppressWorkerProfiling, ::std::optional< int > idealCore)
static MCAPI ::Bedrock::Threading::Mutex & sAllPoolsMutex()
MCAPI void * $ctor(::std::string name, ::Scheduler &owner)
static MCAPI ::brstd::flat_set<::WorkerPool *, ::std::less<::WorkerPool * >, ::std::vector<::WorkerPool * > > & sAllPools()
static MCAPI void _unregisterPool(::WorkerPool &pool)
MCAPI void $dtor()
static MCAPI void _registerPool(::WorkerPool &pool)
MCAPI bool _checkPendingWork()
Definition Alias.h:14