1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Fixes suspend+stop threads not stopping

This commit is contained in:
RipleyTom 2019-08-04 15:21:19 +02:00 committed by Ivan
parent 6e89e4ebbf
commit 05813c7e90

View File

@ -228,6 +228,9 @@ bool cpu_thread::check_state() noexcept
}
const auto [state0, escape] = state.fetch_op([&](bs_t<cpu_flag>& flags)
{
// Atomically clean wait flag and escape
if (!(flags & (cpu_flag::exit + cpu_flag::jit_return + cpu_flag::dbg_global_stop + cpu_flag::ret + cpu_flag::stop)))
{
// Check pause flags which hold thread inside check_state
if (flags & (cpu_flag::pause + cpu_flag::suspend + cpu_flag::dbg_global_pause + cpu_flag::dbg_pause))
@ -235,9 +238,6 @@ bool cpu_thread::check_state() noexcept
return false;
}
// Atomically clean wait flag and escape
if (!(flags & (cpu_flag::exit + cpu_flag::jit_return + cpu_flag::dbg_global_stop + cpu_flag::ret + cpu_flag::stop)))
{
flags -= cpu_flag::wait;
}