Special case Sleep(0) to yield on Linux.

This commit is contained in:
Skyth 2024-12-20 16:36:28 +03:00
parent aed9683975
commit 1376a73c55

View file

@ -524,7 +524,10 @@ uint32_t KeDelayExecutionThread(uint32_t WaitMode, bool Alertable, be<int64_t>*
#ifdef _WIN32
Sleep(timeout);
#else
std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
if (timeout == 0)
std::this_thread::yield();
else
std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
#endif
return STATUS_SUCCESS;