diff --git a/src/core/core.cpp b/src/core/core.cpp index ddd3f4c5b6..a4d66335e8 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -158,7 +158,8 @@ System::ResultStatus System::RunLoop(bool tight_loop) { for (auto& cpu_core : cpu_cores) { if (cpu_core->GetTimer().GetTicks() < global_ticks) { s64 delay = global_ticks - cpu_core->GetTimer().GetTicks(); - kernel->SetRunningCPU(cpu_core.get()); + running_core = cpu_core.get(); + kernel->SetRunningCPU(running_core); cpu_core->GetTimer().Advance(); cpu_core->PrepareReschedule(); kernel->GetThreadManager(cpu_core->GetID()).Reschedule(); @@ -199,7 +200,8 @@ System::ResultStatus System::RunLoop(bool tight_loop) { // TODO: Make special check for idle since we can easily revert the time of idle cores s64 max_slice = Timing::MAX_SLICE_LENGTH; for (const auto& cpu_core : cpu_cores) { - kernel->SetRunningCPU(cpu_core.get()); + running_core = cpu_core.get(); + kernel->SetRunningCPU(running_core); cpu_core->GetTimer().Advance(); cpu_core->PrepareReschedule(); kernel->GetThreadManager(cpu_core->GetID()).Reschedule();