TSX: workaround for check_state freezes

This commit is contained in:
Nekotekina 2021-02-01 18:24:08 +03:00
parent 7b40859eff
commit 390b192f0a

View file

@ -757,7 +757,7 @@ bool cpu_thread::check_state() noexcept
{ {
u64 ctr = g_suspend_counter; u64 ctr = g_suspend_counter;
if (ctr >> 2 == s_tls_sctr >> 2) if (ctr >> 2 == s_tls_sctr >> 2 && state & cpu_flag::pause)
{ {
if (i < 20 || ctr & 1) if (i < 20 || ctr & 1)
{ {
@ -765,7 +765,8 @@ bool cpu_thread::check_state() noexcept
} }
else else
{ {
g_suspend_counter.wait(ctr, -4); // TODO: fix the workaround
g_suspend_counter.wait(ctr, -4, atomic_wait_timeout{100});
} }
} }
else else