vm.cpp/Non-TSX: Fixup potential deadlock

This commit is contained in:
Eladash 2023-08-03 13:26:11 +03:00 committed by Elad Ashkenazi
parent 06c9b95e09
commit 9f625de51a
1 changed files with 7 additions and 2 deletions

View File

@ -391,14 +391,19 @@ namespace vm
return; return;
} }
if (!get_range_lock_bits(true)) [[likely]]
{
return;
}
if (i < 100) if (i < 100)
busy_wait(200); busy_wait(200);
else else
std::this_thread::yield(); std::this_thread::yield();
if (!get_range_lock_bits(true)) [[likely]] if (cpu_flag::wait - cpu.state)
{ {
return; cpu.state += cpu_flag::wait;
} }
} }
} }