summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/scheduler.h
diff options
context:
space:
mode:
authorGravatar Lioncash2019-03-04 16:02:59 -0500
committerGravatar Lioncash2019-03-04 17:01:37 -0500
commitfad20213e6f377d75ced3c2554b4f00a46ff9263 (patch)
tree8911a6765d4549836fec1e5b06c64b5e94f4860d /src/core/hle/kernel/scheduler.h
parentMerge pull request #2165 from ReinUsesLisp/unbind-tex (diff)
downloadyuzu-fad20213e6f377d75ced3c2554b4f00a46ff9263.tar.gz
yuzu-fad20213e6f377d75ced3c2554b4f00a46ff9263.tar.xz
yuzu-fad20213e6f377d75ced3c2554b4f00a46ff9263.zip
kernel/scheduler: Pass in system instance in constructor
Avoids directly relying on the global system instance and instead makes an arbitrary system instance an explicit dependency on construction. This also allows removing dependencies on some global accessor functions as well.
Diffstat (limited to 'src/core/hle/kernel/scheduler.h')
-rw-r--r--src/core/hle/kernel/scheduler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h
index 97ced4dfc..1c5bf57d9 100644
--- a/src/core/hle/kernel/scheduler.h
+++ b/src/core/hle/kernel/scheduler.h
@@ -13,7 +13,8 @@
13 13
14namespace Core { 14namespace Core {
15class ARM_Interface; 15class ARM_Interface;
16} 16class System;
17} // namespace Core
17 18
18namespace Kernel { 19namespace Kernel {
19 20
@@ -21,7 +22,7 @@ class Process;
21 22
22class Scheduler final { 23class Scheduler final {
23public: 24public:
24 explicit Scheduler(Core::ARM_Interface& cpu_core); 25 explicit Scheduler(Core::System& system, Core::ARM_Interface& cpu_core);
25 ~Scheduler(); 26 ~Scheduler();
26 27
27 /// Returns whether there are any threads that are ready to run. 28 /// Returns whether there are any threads that are ready to run.
@@ -162,6 +163,7 @@ private:
162 Core::ARM_Interface& cpu_core; 163 Core::ARM_Interface& cpu_core;
163 u64 last_context_switch_time = 0; 164 u64 last_context_switch_time = 0;
164 165
166 Core::System& system;
165 static std::mutex scheduler_mutex; 167 static std::mutex scheduler_mutex;
166}; 168};
167 169