summaryrefslogtreecommitdiffstats
path: root/src/core/debugger
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-07-08 02:06:46 +0200
committerLiam <byteslice@airmail.cc>2022-07-25 18:14:15 +0200
commit6523854dd6ac2d202dacb2110bc83b8e61621e9a (patch)
treed3d5c5d3048ef0d316692e5f74a78575666114de /src/core/debugger
parentMerge pull request #8549 from liamwhite/kscheduler-sc (diff)
downloadyuzu-6523854dd6ac2d202dacb2110bc83b8e61621e9a.tar
yuzu-6523854dd6ac2d202dacb2110bc83b8e61621e9a.tar.gz
yuzu-6523854dd6ac2d202dacb2110bc83b8e61621e9a.tar.bz2
yuzu-6523854dd6ac2d202dacb2110bc83b8e61621e9a.tar.lz
yuzu-6523854dd6ac2d202dacb2110bc83b8e61621e9a.tar.xz
yuzu-6523854dd6ac2d202dacb2110bc83b8e61621e9a.tar.zst
yuzu-6523854dd6ac2d202dacb2110bc83b8e61621e9a.zip
Diffstat (limited to '')
-rw-r--r--src/core/debugger/debugger.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/debugger/debugger.cpp b/src/core/debugger/debugger.cpp
index ac64d2f9d..e42bdd17d 100644
--- a/src/core/debugger/debugger.cpp
+++ b/src/core/debugger/debugger.cpp
@@ -15,6 +15,7 @@
#include "core/debugger/debugger_interface.h"
#include "core/debugger/gdbstub.h"
#include "core/hle/kernel/global_scheduler_context.h"
+#include "core/hle/kernel/k_scheduler.h"
template <typename Readable, typename Buffer, typename Callback>
static void AsyncReceiveInto(Readable& r, Buffer& buffer, Callback&& c) {
@@ -230,13 +231,12 @@ private:
}
void PauseEmulation() {
+ Kernel::KScopedSchedulerLock sl{system.Kernel()};
+
// Put all threads to sleep on next scheduler round.
for (auto* thread : ThreadList()) {
thread->RequestSuspend(Kernel::SuspendType::Debug);
}
-
- // Signal an interrupt so that scheduler will fire.
- system.Kernel().InterruptAllPhysicalCores();
}
void ResumeEmulation(Kernel::KThread* except = nullptr) {
@@ -253,7 +253,8 @@ private:
template <typename Callback>
void MarkResumed(Callback&& cb) {
- std::scoped_lock lk{connection_lock};
+ Kernel::KScopedSchedulerLock sl{system.Kernel()};
+ std::scoped_lock cl{connection_lock};
stopped = false;
cb();
}