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
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 // vIndex: 0
48 virtual ~WorkerPool() /*override*/;
49 // NOLINTEND
50
51public:
52 // member functions
53 // NOLINTBEGIN
54 MCAPI WorkerPool(::std::string name, ::Scheduler& owner);
55
56 MCAPI WorkerPool(
57 ::std::string name,
58 uint64 threadCount,
60 ::std::optional<uint64> coreAffinityMask,
61 bool idealCore,
62 ::std::optional<int> suppressWorkerProfiling
63 );
64
65 MCAPI bool _checkPendingWork();
66
67 MCAPI void queue(::std::shared_ptr<::BackgroundTaskBase> task, bool queueImmediate);
68
69 MCAPI ::std::shared_ptr<::BackgroundTaskBase> tryPop(int minPriority);
70 // NOLINTEND
71
72public:
73 // static functions
74 // NOLINTBEGIN
75 MCAPI static void _registerPool(::WorkerPool& pool);
76 // NOLINTEND
77
78public:
79 // static variables
80 // NOLINTBEGIN
81 MCAPI static ::brstd::flat_set<::WorkerPool*, ::std::less<::WorkerPool*>, ::std::vector<::WorkerPool*>>&
82 sAllPools();
83
84 MCAPI static ::Bedrock::Threading::Mutex& sAllPoolsMutex();
85 // NOLINTEND
86
87public:
88 // constructor thunks
89 // NOLINTBEGIN
90 MCAPI void* $ctor(::std::string name, ::Scheduler& owner);
91
92 MCAPI void* $ctor(
93 ::std::string name,
94 uint64 threadCount,
96 ::std::optional<uint64> coreAffinityMask,
97 bool idealCore,
98 ::std::optional<int> suppressWorkerProfiling
99 );
100 // NOLINTEND
101
102public:
103 // destructor thunk
104 // NOLINTBEGIN
105 MCAPI void $dtor();
106 // NOLINTEND
107
108public:
109 // vftables
110 // NOLINTBEGIN
111 MCAPI static void** $vftable();
112 // NOLINTEND
113};
Definition BackgroundTaskBase.h:13
Definition EnableNonOwnerReferences.h:7
Definition OSThreadPriority.h:7
Definition Scheduler.h:13
Definition WorkerPool.h:19
Definition Alias.h:14