Skip to content

Commit

Permalink
ntdll: Yield during PulseEvent().
Browse files Browse the repository at this point in the history
May help with #10, although the real fix there is just not to use esync.
  • Loading branch information
zfigura authored and Guy1524 committed Apr 6, 2020
1 parent 7e07711 commit 82f654b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dlls/ntdll/esync.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ NTSTATUS esync_pulse_event( HANDLE handle, LONG *prev )
* used (and publicly deprecated). */
if (write( obj->fd, &value, sizeof(value) ) == -1)
return FILE_GetNtStatus();

/* Try to give other threads a chance to wake up. Hopefully erring on this
* side is the better thing to do... */
NtYieldExecution();

read( obj->fd, &value, sizeof(value) );

current = interlocked_xchg( &event->signaled, 0 );
Expand Down

0 comments on commit 82f654b

Please sign in to comment.