mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Merge pull request #9601 from liamwhite/it-never-ends
qt: unlock during signal emission
This commit is contained in:
commit
0eae0b6803
2 changed files with 21 additions and 2 deletions
|
@ -96,9 +96,9 @@ void EmuThread::run() {
|
||||||
m_is_running.store(false);
|
m_is_running.store(false);
|
||||||
m_is_running.notify_all();
|
m_is_running.notify_all();
|
||||||
|
|
||||||
emit DebugModeEntered();
|
EmulationPaused(lk);
|
||||||
Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return m_should_run; });
|
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
|
#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
|
#ifdef HAS_OPENGL
|
||||||
class OpenGLSharedContext : public Core::Frontend::GraphicsContext {
|
class OpenGLSharedContext : public Core::Frontend::GraphicsContext {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -91,6 +91,10 @@ public:
|
||||||
m_stop_source.request_stop();
|
m_stop_source.request_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void EmulationPaused(std::unique_lock<std::mutex>& lk);
|
||||||
|
void EmulationResumed(std::unique_lock<std::mutex>& lk);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Core::System& m_system;
|
Core::System& m_system;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue