CPUThread.cpp: Fix cpu_flag::pending reset

This commit is contained in:
Eladash 2022-08-10 16:17:59 +03:00 committed by Ivan
parent 501ca4bcf5
commit 133e9d4705

View file

@ -775,14 +775,12 @@ bool cpu_thread::check_state() noexcept
cpu_counter::add(this);
}
constexpr auto pending_and_temp = (cpu_flag::pending + cpu_flag::temp);
if ((state0 & pending_and_temp) == cpu_flag::pending)
if (cpu_can_stop && state0 & cpu_flag::pending)
{
// Execute pending work
cpu_work();
if ((state1 ^ state) - pending_and_temp)
if ((state1 ^ state) - cpu_flag::pending)
{
// Work could have changed flags
// Reset internal flags as if check_state() has just been called