CPU: Fix g_suspend_counter waiting logic

This commit is contained in:
Nekotekina 2020-11-18 09:17:15 +03:00
parent 28cbba5a7d
commit 190676c982

View File

@ -738,13 +738,16 @@ bool cpu_thread::check_state() noexcept
{ {
u64 ctr = g_suspend_counter; u64 ctr = g_suspend_counter;
if (i < 20 || ctr & 1) if (ctr >> 2 == s_tls_sctr >> 2)
{ {
busy_wait(300); if (i < 20 || ctr & 1)
} {
else if (ctr >> 2 == s_tls_sctr >> 2) busy_wait(300);
{ }
g_suspend_counter.wait(ctr, -4); else
{
g_suspend_counter.wait(ctr, -4);
}
} }
else else
{ {