Merge 0f16ed5da9
into 53b54406bd
This commit is contained in:
commit
7f5389e932
|
@ -1052,15 +1052,15 @@ void UpdateInputGate(bool require_focus, bool require_full_focus)
|
|||
}
|
||||
|
||||
CPUThreadGuard::CPUThreadGuard(Core::System& system)
|
||||
: m_system(system), m_was_cpu_thread(IsCPUThread())
|
||||
: m_system(system), m_was_cpu_thread(IsCPUThread()), m_has_cpu_thread(IsRunningAndStarted())
|
||||
{
|
||||
if (!m_was_cpu_thread)
|
||||
m_was_unpaused = PauseAndLock(system, true, true);
|
||||
if (m_has_cpu_thread && !m_was_cpu_thread)
|
||||
m_was_unpaused = PauseAndLock(m_system, true, true);
|
||||
}
|
||||
|
||||
CPUThreadGuard::~CPUThreadGuard()
|
||||
{
|
||||
if (!m_was_cpu_thread)
|
||||
if (m_has_cpu_thread && !m_was_cpu_thread)
|
||||
PauseAndLock(m_system, false, m_was_unpaused);
|
||||
}
|
||||
|
||||
|
|
|
@ -115,6 +115,7 @@ public:
|
|||
private:
|
||||
Core::System& m_system;
|
||||
const bool m_was_cpu_thread;
|
||||
const bool m_has_cpu_thread;
|
||||
bool m_was_unpaused = false;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue