diff options
| author | 2019-10-27 22:13:51 -0400 | |
|---|---|---|
| committer | 2019-10-27 22:13:55 -0400 | |
| commit | 2fb0bbff29cc2f1330b773db2f57b09bf1476036 (patch) | |
| tree | e440abc3c917666cecad585394348c9f6ec8b6d4 /src | |
| parent | scheduler: Amend documentation comments (diff) | |
| download | yuzu-2fb0bbff29cc2f1330b773db2f57b09bf1476036.tar.gz yuzu-2fb0bbff29cc2f1330b773db2f57b09bf1476036.tar.xz yuzu-2fb0bbff29cc2f1330b773db2f57b09bf1476036.zip | |
scheduler: Initialize class members directly where applicable
Reduces the overall amount of code.
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/kernel/scheduler.h | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index 53281cc6c..8353308aa 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -22,9 +22,9 @@ | |||
| 22 | 22 | ||
| 23 | namespace Kernel { | 23 | namespace Kernel { |
| 24 | 24 | ||
| 25 | GlobalScheduler::GlobalScheduler(Core::System& system) : system{system} { | 25 | GlobalScheduler::GlobalScheduler(Core::System& system) : system{system} {} |
| 26 | is_reselection_pending = false; | 26 | |
| 27 | } | 27 | GlobalScheduler::~GlobalScheduler() = default; |
| 28 | 28 | ||
| 29 | void GlobalScheduler::AddThread(SharedPtr<Thread> thread) { | 29 | void GlobalScheduler::AddThread(SharedPtr<Thread> thread) { |
| 30 | thread_list.push_back(std::move(thread)); | 30 | thread_list.push_back(std::move(thread)); |
| @@ -357,8 +357,6 @@ void GlobalScheduler::Shutdown() { | |||
| 357 | thread_list.clear(); | 357 | thread_list.clear(); |
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | GlobalScheduler::~GlobalScheduler() = default; | ||
| 361 | |||
| 362 | Scheduler::Scheduler(Core::System& system, Core::ARM_Interface& cpu_core, u32 core_id) | 360 | Scheduler::Scheduler(Core::System& system, Core::ARM_Interface& cpu_core, u32 core_id) |
| 363 | : system(system), cpu_core(cpu_core), core_id(core_id) {} | 361 | : system(system), cpu_core(cpu_core), core_id(core_id) {} |
| 364 | 362 | ||
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h index 8f1f39c59..74feecc06 100644 --- a/src/core/hle/kernel/scheduler.h +++ b/src/core/hle/kernel/scheduler.h | |||
| @@ -150,7 +150,7 @@ private: | |||
| 150 | static constexpr u32 min_regular_priority = 2; | 150 | static constexpr u32 min_regular_priority = 2; |
| 151 | std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> scheduled_queue; | 151 | std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> scheduled_queue; |
| 152 | std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> suggested_queue; | 152 | std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> suggested_queue; |
| 153 | std::atomic<bool> is_reselection_pending; | 153 | std::atomic<bool> is_reselection_pending{false}; |
| 154 | 154 | ||
| 155 | // The priority levels at which the global scheduler preempts threads every 10 ms. They are | 155 | // The priority levels at which the global scheduler preempts threads every 10 ms. They are |
| 156 | // ordered from Core 0 to Core 3. | 156 | // ordered from Core 0 to Core 3. |