Merge pull request #8763 from JosJuice/panic-alert-deadlock-gpu

DolphinQt: Fix the panic alert deadlock, dual core edition
This commit is contained in:
Admiral H. Curtiss
2022-05-16 02:21:14 +02:00
committed by GitHub
5 changed files with 83 additions and 25 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);
}