From 6bd5473d5661dc33425d8da6e3df4f587f417fde Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 6 Jun 2023 18:04:21 +0200 Subject: [PATCH] Core: Declare emu thread as CPU thread while shutting down Fixes https://bugs.dolphin-emu.org/issues/13274. --- Source/Core/Core/Core.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index c73fe46fd9..e53ad19ae0 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -679,6 +679,10 @@ static void EmuThread(std::unique_ptr boot, WindowSystemInfo wsi // Join with the CPU thread. s_cpu_thread.join(); INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "CPU thread stopped.")); + + // Redeclare this thread as the CPU thread, so that the code running in the scope guards doesn't + // think we're doing anything unsafe by doing stuff that could race with the CPU thread. + DeclareAsCPUThread(); } else // SingleCore mode {