summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2018-08-12 17:50:44 -0500
committerGravatar Subv2018-08-12 18:41:11 -0500
commit3a338d9286bb7c8a4e169914965e6241c466bc6a (patch)
tree3d973bb9e44e08a979fed6d42a5169abad1ddc34 /src
parentKernel/Threads: Lock the HLE mutex when executing the wakeup callback. (diff)
downloadyuzu-3a338d9286bb7c8a4e169914965e6241c466bc6a.tar.gz
yuzu-3a338d9286bb7c8a4e169914965e6241c466bc6a.tar.xz
yuzu-3a338d9286bb7c8a4e169914965e6241c466bc6a.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/core/core_cpu.cpp3
1 files changed, 3 insertions, 0 deletions
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 @@
14#include "core/core_timing.h" 14#include "core/core_timing.h"
15#include "core/hle/kernel/scheduler.h" 15#include "core/hle/kernel/scheduler.h"
16#include "core/hle/kernel/thread.h" 16#include "core/hle/kernel/thread.h"
17#include "core/hle/lock.h"
17#include "core/settings.h" 18#include "core/settings.h"
18 19
19namespace Core { 20namespace Core {
@@ -125,6 +126,8 @@ void Cpu::Reschedule() {
125 } 126 }
126 127
127 reschedule_pending = false; 128 reschedule_pending = false;
129 // Lock the global kernel mutex when we manipulate the HLE state
130 std::lock_guard<std::recursive_mutex> lock(HLE::g_hle_lock);
128 scheduler->Reschedule(); 131 scheduler->Reschedule();
129} 132}
130 133