mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-03 13:49:58 +00:00
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.
This commit is contained in:
parent
84b542c386
commit
3a338d9286
1 changed files with 3 additions and 0 deletions
|
@ -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<std::recursive_mutex> lock(HLE::g_hle_lock);
|
||||
scheduler->Reschedule();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue