diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-01-10 15:27:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-10 15:27:12 -0500 |
commit | 0eae0b680312c6e57fa5f25de18b9ad0b42f550b (patch) | |
tree | 047cf75e640720c237c97b2e5315dedbbe8ce9fb /src/yuzu/bootmanager.cpp | |
parent | 74404261d22ff9d22da20c2fbe8b845388e8db41 (diff) | |
parent | 385ddef8c331117f16ccb681a8bd47e0603e9f3c (diff) |
Merge pull request #9601 from liamwhite/it-never-ends
qt: unlock during signal emission
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r-- | src/yuzu/bootmanager.cpp | 19 |
1 files changed, 17 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() { m_is_running.store(false); m_is_running.notify_all(); - emit DebugModeEntered(); + EmulationPaused(lk); Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return m_should_run; }); - emit DebugModeLeft(); + EmulationResumed(lk); } } @@ -111,6 +111,21 @@ void EmuThread::run() { #endif } +// Unlock while emitting signals so that the main thread can +// continue pumping events. + +void EmuThread::EmulationPaused(std::unique_lock<std::mutex>& lk) { + lk.unlock(); + emit DebugModeEntered(); + lk.lock(); +} + +void EmuThread::EmulationResumed(std::unique_lock<std::mutex>& lk) { + lk.unlock(); + emit DebugModeLeft(); + lk.lock(); +} + #ifdef HAS_OPENGL class OpenGLSharedContext : public Core::Frontend::GraphicsContext { public: |