From dea1d01de2051a99a2a811e551fe9f427be36129 Mon Sep 17 00:00:00 2001 From: Eladash Date: Wed, 3 Mar 2021 06:05:21 +0200 Subject: [PATCH] Fix Emulator::Stop race with IDM Newly created threads' state could have not been flagged with exit. --- rpcs3/Emu/CPU/CPUThread.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index bd69a41b37..978b658403 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -614,6 +614,12 @@ cpu_thread::cpu_thread(u32 id) break; } + if (Emu.IsStopped()) + { + // For similar race as above + state += cpu_flag::exit; + } + g_threads_created++; }