diff options
| author | 2019-09-10 15:26:24 -0400 | |
|---|---|---|
| committer | 2019-10-15 11:55:15 -0400 | |
| commit | 2d382de6fa79123fae7842246588651ee99b15e2 (patch) | |
| tree | c260840e12ccbb1181117403c7e463b55bfa0e5f /src/core/hle/kernel/scheduler.cpp | |
| parent | Kernel: Initial implementation of thread preemption. (diff) | |
| download | yuzu-2d382de6fa79123fae7842246588651ee99b15e2.tar.gz yuzu-2d382de6fa79123fae7842246588651ee99b15e2.tar.xz yuzu-2d382de6fa79123fae7842246588651ee99b15e2.zip | |
Scheduler: Corrections to YieldAndBalanceLoad and Yield bombing protection.
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index 0d45307cd..78463cef5 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -165,12 +165,12 @@ bool GlobalScheduler::YieldThreadAndBalanceLoad(Thread* yielding_thread) { | |||
| 165 | continue; | 165 | continue; |
| 166 | } | 166 | } |
| 167 | } | 167 | } |
| 168 | if (next_thread->GetLastRunningTicks() >= thread->GetLastRunningTicks() || | 168 | } |
| 169 | next_thread->GetPriority() < thread->GetPriority()) { | 169 | if (next_thread->GetLastRunningTicks() >= thread->GetLastRunningTicks() || |
| 170 | if (thread->GetPriority() <= priority) { | 170 | next_thread->GetPriority() < thread->GetPriority()) { |
| 171 | winner = thread; | 171 | if (thread->GetPriority() <= priority) { |
| 172 | break; | 172 | winner = thread; |
| 173 | } | 173 | break; |
| 174 | } | 174 | } |
| 175 | } | 175 | } |
| 176 | } | 176 | } |
| @@ -240,7 +240,7 @@ bool GlobalScheduler::YieldThreadAndWaitForLoadBalancing(Thread* yielding_thread | |||
| 240 | 240 | ||
| 241 | void GlobalScheduler::PreemptThreads() { | 241 | void GlobalScheduler::PreemptThreads() { |
| 242 | for (std::size_t core_id = 0; core_id < NUM_CPU_CORES; core_id++) { | 242 | for (std::size_t core_id = 0; core_id < NUM_CPU_CORES; core_id++) { |
| 243 | const u64 priority = preemption_priorities[core_id]; | 243 | const u32 priority = preemption_priorities[core_id]; |
| 244 | if (scheduled_queue[core_id].size(priority) > 1) { | 244 | if (scheduled_queue[core_id].size(priority) > 1) { |
| 245 | scheduled_queue[core_id].yield(priority); | 245 | scheduled_queue[core_id].yield(priority); |
| 246 | reselection_pending.store(true, std::memory_order_release); | 246 | reselection_pending.store(true, std::memory_order_release); |