SVC: Correct races on physical core switching.

This commit is contained in:
Fernando Sahmkow committed 2020-06-27 11:35:19 -04:00
1 parent cc3aa95926
commit bd36eaf15d
2 files changed
+10 -10

No files matched your search

+6 -5
View File
@@ -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();
}
}