summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/yuzu/bootmanager.cpp19
-rw-r--r--src/yuzu/bootmanager.h4
2 files changed, 21 insertions, 2 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 3d560f303..d65991734 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -96,9 +96,9 @@ void EmuThread::run() {
96 m_is_running.store(false); 96 m_is_running.store(false);
97 m_is_running.notify_all(); 97 m_is_running.notify_all();
98 98
99 emit DebugModeEntered(); 99 EmulationPaused(lk);
100 Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return m_should_run; }); 100 Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return m_should_run; });
101 emit DebugModeLeft(); 101 EmulationResumed(lk);
102 } 102 }
103 } 103 }
104 104
@@ -111,6 +111,21 @@ void EmuThread::run() {
111#endif 111#endif
112} 112}
113 113
114// Unlock while emitting signals so that the main thread can
115// continue pumping events.
116
117void EmuThread::EmulationPaused(std::unique_lock<std::mutex>& lk) {
118 lk.unlock();
119 emit DebugModeEntered();
120 lk.lock();
121}
122
123void EmuThread::EmulationResumed(std::unique_lock<std::mutex>& lk) {
124 lk.unlock();
125 emit DebugModeLeft();
126 lk.lock();
127}
128
114#ifdef HAS_OPENGL 129#ifdef HAS_OPENGL
115class OpenGLSharedContext : public Core::Frontend::GraphicsContext { 130class OpenGLSharedContext : public Core::Frontend::GraphicsContext {
116public: 131public:
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h
index eca16b313..092c6206f 100644
--- a/src/yuzu/bootmanager.h
+++ b/src/yuzu/bootmanager.h
@@ -92,6 +92,10 @@ public:
92 } 92 }
93 93
94private: 94private:
95 void EmulationPaused(std::unique_lock<std::mutex>& lk);
96 void EmulationResumed(std::unique_lock<std::mutex>& lk);
97
98private:
95 Core::System& m_system; 99 Core::System& m_system;
96 100
97 std::stop_source m_stop_source; 101 std::stop_source m_stop_source;