summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/scheduler.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-03-08 21:13:18 -0400
committerGravatar Fernando Sahmkow2020-06-27 11:35:41 -0400
commit391f5f360d4144c21d65b998dd4e467b56533f78 (patch)
treed22922c1d44946632747427f763a6ad743876d64 /src/core/hle/kernel/scheduler.cpp
parentKernel: Corrections to TimeManager, Scheduler and Mutex. (diff)
downloadyuzu-391f5f360d4144c21d65b998dd4e467b56533f78.tar.gz
yuzu-391f5f360d4144c21d65b998dd4e467b56533f78.tar.xz
yuzu-391f5f360d4144c21d65b998dd4e467b56533f78.zip
Scheduler: Set last running time on thread.
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
-rw-r--r--src/core/hle/kernel/scheduler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index 98fbb8fe5..d68d86cdf 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -616,6 +616,7 @@ void Scheduler::SwitchContextStep2() {
616 616
617 // Cancel any outstanding wakeup events for this thread 617 // Cancel any outstanding wakeup events for this thread
618 new_thread->SetIsRunning(true); 618 new_thread->SetIsRunning(true);
619 new_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
619 620
620 auto* const thread_owner_process = current_thread->GetOwnerProcess(); 621 auto* const thread_owner_process = current_thread->GetOwnerProcess();
621 if (previous_process != thread_owner_process && thread_owner_process != nullptr) { 622 if (previous_process != thread_owner_process && thread_owner_process != nullptr) {
@@ -654,6 +655,7 @@ void Scheduler::SwitchContext() {
654 655
655 // Save context for previous thread 656 // Save context for previous thread
656 if (previous_thread) { 657 if (previous_thread) {
658 previous_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
657 if (!previous_thread->IsHLEThread()) { 659 if (!previous_thread->IsHLEThread()) {
658 auto& cpu_core = system.ArmInterface(core_id); 660 auto& cpu_core = system.ArmInterface(core_id);
659 cpu_core.SaveContext(previous_thread->GetContext32()); 661 cpu_core.SaveContext(previous_thread->GetContext32());