summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/scheduler.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-12 21:48:43 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:48 +0200
commit7020d498c5aef7c1180bfc57031cdd7fbfecdf0f (patch)
treef2508e39a02966cdd4d9acda1e14ed93cdc150cd /src/core/hle/kernel/scheduler.cpp
parentGeneral: Fix Stop function (diff)
downloadyuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.gz
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.bz2
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.lz
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.xz
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.tar.zst
yuzu-7020d498c5aef7c1180bfc57031cdd7fbfecdf0f.zip
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
-rw-r--r--src/core/hle/kernel/scheduler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index 25fc8a3e8..2ad380b17 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -354,7 +354,9 @@ void GlobalScheduler::EnableInterruptAndSchedule(u32 cores_pending_reschedule,
}
if (must_context_switch) {
auto& core_scheduler = kernel.CurrentScheduler();
+ kernel.ExitSVCProfile();
core_scheduler.TryDoContextSwitch();
+ kernel.EnterSVCProfile();
}
}
@@ -628,6 +630,7 @@ void Scheduler::Reload() {
// Cancel any outstanding wakeup events for this thread
thread->SetIsRunning(true);
+ thread->SetWasRunning(false);
thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
auto* const thread_owner_process = thread->GetOwnerProcess();
@@ -660,6 +663,7 @@ void Scheduler::SwitchContextStep2() {
// Cancel any outstanding wakeup events for this thread
new_thread->SetIsRunning(true);
new_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
+ new_thread->SetWasRunning(false);
auto* const thread_owner_process = current_thread->GetOwnerProcess();
if (previous_process != thread_owner_process && thread_owner_process != nullptr) {
@@ -698,6 +702,9 @@ void Scheduler::SwitchContext() {
// Save context for previous thread
if (previous_thread) {
+ if (new_thread != nullptr && new_thread->IsSuspendThread()) {
+ previous_thread->SetWasRunning(true);
+ }
previous_thread->SetContinuousOnSVC(false);
previous_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
if (!previous_thread->IsHLEThread()) {