From fc331da883e924edcac200b00a42483163ff3cfb Mon Sep 17 00:00:00 2001 From: Eladash Date: Wed, 14 Sep 2022 22:59:59 +0300 Subject: [PATCH] CPU preemption control: remove yield before thread stop --- rpcs3/Emu/CPU/CPUThread.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index 96c80a8cdf..6c445c284e 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -783,9 +783,12 @@ bool cpu_thread::check_state() noexcept { if (cpu_flag::wait - state0) { - // Yield itself - escape = false; - state0 += cpu_flag::yield; + if (!escape || !retval) + { + // Yield itself + state0 += cpu_flag::yield; + escape = false; + } } if (const u128 bits = s_cpu_bits)