summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-09-10 21:26:24 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-15 17:55:15 +0200
commit2d382de6fa79123fae7842246588651ee99b15e2 (patch)
treec260840e12ccbb1181117403c7e463b55bfa0e5f /src/core/hle
parentKernel: Initial implementation of thread preemption. (diff)
downloadyuzu-2d382de6fa79123fae7842246588651ee99b15e2.tar
yuzu-2d382de6fa79123fae7842246588651ee99b15e2.tar.gz
yuzu-2d382de6fa79123fae7842246588651ee99b15e2.tar.bz2
yuzu-2d382de6fa79123fae7842246588651ee99b15e2.tar.lz
yuzu-2d382de6fa79123fae7842246588651ee99b15e2.tar.xz
yuzu-2d382de6fa79123fae7842246588651ee99b15e2.tar.zst
yuzu-2d382de6fa79123fae7842246588651ee99b15e2.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/kernel/scheduler.cpp14
-rw-r--r--src/core/hle/kernel/scheduler.h2
2 files changed, 8 insertions, 8 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) {
continue;
}
}
- if (next_thread->GetLastRunningTicks() >= thread->GetLastRunningTicks() ||
- next_thread->GetPriority() < thread->GetPriority()) {
- if (thread->GetPriority() <= priority) {
- winner = thread;
- break;
- }
+ }
+ if (next_thread->GetLastRunningTicks() >= thread->GetLastRunningTicks() ||
+ next_thread->GetPriority() < thread->GetPriority()) {
+ if (thread->GetPriority() <= priority) {
+ winner = thread;
+ break;
}
}
}
@@ -240,7 +240,7 @@ bool GlobalScheduler::YieldThreadAndWaitForLoadBalancing(Thread* yielding_thread
void GlobalScheduler::PreemptThreads() {
for (std::size_t core_id = 0; core_id < NUM_CPU_CORES; core_id++) {
- const u64 priority = preemption_priorities[core_id];
+ const u32 priority = preemption_priorities[core_id];
if (scheduled_queue[core_id].size(priority) > 1) {
scheduled_queue[core_id].yield(priority);
reselection_pending.store(true, std::memory_order_release);
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h
index c13a368fd..408e20c88 100644
--- a/src/core/hle/kernel/scheduler.h
+++ b/src/core/hle/kernel/scheduler.h
@@ -155,7 +155,7 @@ private:
std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> suggested_queue;
std::atomic<bool> reselection_pending;
- std::array<u64, NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 62};
+ std::array<u32, NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 62};
/// Lists all thread ids that aren't deleted/etc.
std::vector<SharedPtr<Thread>> thread_list;