atomic.cpp: fix windows/std path

Always check condition after rearming internal semaphore.
This commit is contained in:
Nekotekina 2020-11-25 04:01:53 +03:00
parent 00e64920c8
commit 600c0ea5ba

View file

@ -1231,8 +1231,7 @@ atomic_wait_engine::wait(const void* data, u32 size, __m128i old_value, u64 time
break; break;
} }
} }
else if (timeout + 1)
if (timeout + 1)
{ {
cond->cv->wait_for(lock, std::chrono::nanoseconds(timeout)); cond->cv->wait_for(lock, std::chrono::nanoseconds(timeout));
} }
@ -1258,15 +1257,11 @@ atomic_wait_engine::wait(const void* data, u32 size, __m128i old_value, u64 time
{ {
break; break;
} }
fallback = false;
break;
} }
fallback = false; fallback = false;
} }
else if (NtWaitForAlertByThreadId)
if (NtWaitForAlertByThreadId)
{ {
switch (DWORD status = NtWaitForAlertByThreadId(cond, timeout + 1 ? &qw : nullptr)) switch (DWORD status = NtWaitForAlertByThreadId(cond, timeout + 1 ? &qw : nullptr))
{ {