aboutsummaryrefslogtreecommitdiff
path: root/src/core/cpu_manager.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-02-27 11:25:42 -0400
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 11:35:19 -0400
commitbd36eaf15d88c3875aba7032fe5124fbb150bd5d (patch)
treea6bad69cf31a39e0286d4cd14d404497ecfb9c42 /src/core/cpu_manager.cpp
parentcc3aa959265480e1990b10ee37ebf1c0ade3da64 (diff)
SVC: Correct races on physical core switching.
Diffstat (limited to 'src/core/cpu_manager.cpp')
-rw-r--r--src/core/cpu_manager.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 241971ff38..904aacd97e 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -79,12 +79,13 @@ void CpuManager::RunGuestThread() {
sched.OnThreadStart();
}
while (true) {
- auto& physical_core = kernel.CurrentPhysicalCore();
- while (!physical_core.IsInterrupted()) {
- physical_core.Run();
+ auto* physical_core = &kernel.CurrentPhysicalCore();
+ while (!physical_core->IsInterrupted()) {
+ physical_core->Run();
+ physical_core = &kernel.CurrentPhysicalCore();
}
- physical_core.ClearExclusive();
- auto& scheduler = physical_core.Scheduler();
+ physical_core->ClearExclusive();
+ auto& scheduler = physical_core->Scheduler();
scheduler.TryDoContextSwitch();
}
}