diff options
| author | 2019-10-27 22:39:20 -0400 | |
|---|---|---|
| committer | 2019-10-27 23:35:50 -0400 | |
| commit | 6c8f28813c5ad9c3636638851a752ff5d33155f3 (patch) | |
| tree | 7aef0214a4b7acd7388d4a8902c3997b1bcef763 | |
| parent | scheduler: Silence sign conversion warnings (diff) | |
| download | yuzu-6c8f28813c5ad9c3636638851a752ff5d33155f3.tar.gz yuzu-6c8f28813c5ad9c3636638851a752ff5d33155f3.tar.xz yuzu-6c8f28813c5ad9c3636638851a752ff5d33155f3.zip | |
scheduler: Mark parameter of AskForReselectionOrMarkRedundant() as const
This is only compared against, so it can be made const.
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, 5 insertions, 5 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index 9a38fa50c..0e2dbf13e 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -107,11 +107,10 @@ bool GlobalScheduler::YieldThread(Thread* yielding_thread) { | |||
| 107 | const u32 priority = yielding_thread->GetPriority(); | 107 | const u32 priority = yielding_thread->GetPriority(); |
| 108 | 108 | ||
| 109 | // Yield the thread | 109 | // Yield the thread |
| 110 | ASSERT_MSG(yielding_thread == scheduled_queue[core_id].front(priority), | 110 | const Thread* const winner = scheduled_queue[core_id].front(priority); |
| 111 | "Thread yielding without being in front"); | 111 | ASSERT_MSG(yielding_thread == winner, "Thread yielding without being in front"); |
| 112 | scheduled_queue[core_id].yield(priority); | 112 | scheduled_queue[core_id].yield(priority); |
| 113 | 113 | ||
| 114 | Thread* winner = scheduled_queue[core_id].front(priority); | ||
| 115 | return AskForReselectionOrMarkRedundant(yielding_thread, winner); | 114 | return AskForReselectionOrMarkRedundant(yielding_thread, winner); |
| 116 | } | 115 | } |
| 117 | 116 | ||
| @@ -339,7 +338,8 @@ void GlobalScheduler::TransferToCore(u32 priority, s32 destination_core, Thread* | |||
| 339 | } | 338 | } |
| 340 | } | 339 | } |
| 341 | 340 | ||
| 342 | bool GlobalScheduler::AskForReselectionOrMarkRedundant(Thread* current_thread, Thread* winner) { | 341 | bool GlobalScheduler::AskForReselectionOrMarkRedundant(Thread* current_thread, |
| 342 | const Thread* winner) { | ||
| 343 | if (current_thread == winner) { | 343 | if (current_thread == winner) { |
| 344 | current_thread->IncrementYieldCount(); | 344 | current_thread->IncrementYieldCount(); |
| 345 | return true; | 345 | return true; |
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h index 74feecc06..f2d6311b8 100644 --- a/src/core/hle/kernel/scheduler.h +++ b/src/core/hle/kernel/scheduler.h | |||
| @@ -145,7 +145,7 @@ public: | |||
| 145 | void Shutdown(); | 145 | void Shutdown(); |
| 146 | 146 | ||
| 147 | private: | 147 | private: |
| 148 | bool AskForReselectionOrMarkRedundant(Thread* current_thread, Thread* winner); | 148 | bool AskForReselectionOrMarkRedundant(Thread* current_thread, const Thread* winner); |
| 149 | 149 | ||
| 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; |