This implements the general fix from b1a79c6b9c3ada0c34b1411b60879962f1815e4d (in particular, making sure that Sleep(0) will not immediately resume execution of the thread if there are no other runnable threads) while preserving the existing behavior of NtYieldExecution() / SwitchToThread(). Thanks RĂ©mi for the idea.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/ntdll/unix/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 137d8d2c87d..58fcc913fb7 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -1480,7 +1480,7 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou }
/* Note that we yield after establishing the desired timeout */ - NtYieldExecution(); + usleep(0); if (!when) return STATUS_SUCCESS;
for (;;)