From 3a338d9286bb7c8a4e169914965e6241c466bc6a Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 12 Aug 2018 17:50:44 -0500 Subject: CPU/HLE: Lock the HLE mutex before performing a reschedule. Another thread might be in the middle of an SVC, thus altering the state of the schedulers. --- src/core/core_cpu.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core') diff --git a/src/core/core_cpu.cpp b/src/core/core_cpu.cpp index 46a522fcd..9b306faf6 100644 --- a/src/core/core_cpu.cpp +++ b/src/core/core_cpu.cpp @@ -14,6 +14,7 @@ #include "core/core_timing.h" #include "core/hle/kernel/scheduler.h" #include "core/hle/kernel/thread.h" +#include "core/hle/lock.h" #include "core/settings.h" namespace Core { @@ -125,6 +126,8 @@ void Cpu::Reschedule() { } reschedule_pending = false; + // Lock the global kernel mutex when we manipulate the HLE state + std::lock_guard lock(HLE::g_hle_lock); scheduler->Reschedule(); } -- cgit v1.2.3