From 2a0278fbb1828662c40f25de7920a2cdd6bc8670 Mon Sep 17 00:00:00 2001 From: Eladash Date: Sun, 6 Aug 2023 12:24:32 +0300 Subject: [PATCH] Fixup SPU/PPU Cache Abortion --- rpcs3/Emu/Cell/PPUThread.cpp | 5 +++++ rpcs3/Emu/Cell/SPURecompiler.cpp | 5 +++++ rpcs3/Emu/system_progress.cpp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index b339116c97..a052453071 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -1823,6 +1823,11 @@ void ppu_thread::cpu_task() // We don't want to open a cell dialog while a native progress dialog is still open. while (u32 v = g_progr_ptotal) { + if (Emu.IsStopped()) + { + return; + } + g_progr_ptotal.wait(v); } diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 8019a7f24e..49ff59a856 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -649,6 +649,11 @@ void spu_cache::initialize() // Initialize progress dialog (wait for previous progress done) while (u32 v = g_progr_ptotal) { + if (Emu.IsStopped()) + { + break; + } + g_progr_ptotal.wait(v); } diff --git a/rpcs3/Emu/system_progress.cpp b/rpcs3/Emu/system_progress.cpp index 6ce68a668e..3869262349 100644 --- a/rpcs3/Emu/system_progress.cpp +++ b/rpcs3/Emu/system_progress.cpp @@ -226,6 +226,11 @@ void progress_dialog_server::operator()() native_dlg->set_text("Stopping. Please wait..."); native_dlg->refresh(); } + + if (g_progr_ptotal.exchange(0)) + { + g_progr_ptotal.notify_all(); + } } progress_dialog_server::~progress_dialog_server()