diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-02-28 00:12:41 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-27 17:35:20 +0200 |
commit | 04e0f8776c26930d7dc8015e53914b11bf1929c1 (patch) | |
tree | 4a8288d6bf8655a2ec0595fdc6d41a3037c5fcad /src/core/hle/kernel/scheduler.cpp | |
parent | SVC: Correct races on physical core switching. (diff) | |
download | yuzu-04e0f8776c26930d7dc8015e53914b11bf1929c1.tar yuzu-04e0f8776c26930d7dc8015e53914b11bf1929c1.tar.gz yuzu-04e0f8776c26930d7dc8015e53914b11bf1929c1.tar.bz2 yuzu-04e0f8776c26930d7dc8015e53914b11bf1929c1.tar.lz yuzu-04e0f8776c26930d7dc8015e53914b11bf1929c1.tar.xz yuzu-04e0f8776c26930d7dc8015e53914b11bf1929c1.tar.zst yuzu-04e0f8776c26930d7dc8015e53914b11bf1929c1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index 758fa8188..727d2e6cc 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp @@ -581,6 +581,7 @@ void Scheduler::SwitchContextStep2() { if (new_thread) { new_thread->context_guard.lock(); + cpu_core.Lock(); ASSERT_MSG(new_thread->GetProcessorID() == s32(this->core_id), "Thread must be assigned to this core."); ASSERT_MSG(new_thread->GetStatus() == ThreadStatus::Ready, @@ -601,6 +602,7 @@ void Scheduler::SwitchContextStep2() { cpu_core.LoadContext(new_thread->GetContext64()); cpu_core.SetTlsAddress(new_thread->GetTLSAddress()); cpu_core.SetTPIDR_EL0(new_thread->GetTPIDR_EL0()); + cpu_core.ClearExclusiveState(); } } else { current_thread = nullptr; @@ -639,6 +641,7 @@ void Scheduler::SwitchContext() { } previous_thread->SetIsRunning(false); previous_thread->context_guard.unlock(); + cpu_core.Unlock(); } std::shared_ptr<Common::Fiber> old_context; |