DolphinQt: Fix the panic alert deadlock, GPU thread edition

The fix in ef77872 worked for panic alerts from
the CPU thread, but there were still problems with
panic alerts from the GPU thread in dual core mode.
This change attempts to fix those.
This commit is contained in:
JosJuice
2020-04-25 00:26:51 +02:00
parent 07fd17445c
commit 3367e5e026
5 changed files with 59 additions and 21 deletions

View File

@ -421,10 +421,10 @@ bool RenderWidget::event(QEvent* event)
if (Config::Get(Config::MAIN_PAUSE_ON_FOCUS_LOST) && Core::GetState() == Core::State::Running)
{
// If we are declared as the CPU thread, it means that the real CPU thread is waiting
// for us to finish showing a panic alert (with that panic alert likely being the cause
// of this event), so trying to pause the real CPU thread would cause a deadlock
if (!Core::IsCPUThread())
// If we are declared as the CPU or GPU thread, it means that the real CPU or GPU thread
// is waiting for us to finish showing a panic alert (with that panic alert likely being
// the cause of this event), so trying to pause the core would cause a deadlock
if (!Core::IsCPUThread() && !Core::IsGPUThread())
Core::SetState(Core::State::Paused);
}