From a181700dbf6aee3082a1c6074b3aab97560b5ef8 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 26 May 2020 16:41:36 +0000 Subject: [PATCH] dispatch: use auto-reset event for dispatch queue Use an auto-reset event for the dispatch queue on Windows. On Linux, `eventfd` is used, which is auto-reset unless `EFD_SEMAPHORE` is specified. This mirrors that behaviour. The test suite continues to pass after this change. --- src/queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/queue.c b/src/queue.c index b07a8a659..493de3f21 100644 --- a/src/queue.c +++ b/src/queue.c @@ -6560,7 +6560,7 @@ _dispatch_runloop_queue_handle_init(void *ctxt) handle = fd; #elif defined(_WIN32) HANDLE hEvent; - hEvent = CreateEventW(NULL, /*bManualReset=*/TRUE, + hEvent = CreateEventW(NULL, /*bManualReset=*/FALSE, /*bInitialState=*/FALSE, NULL); if (hEvent == NULL) { DISPATCH_INTERNAL_CRASH(GetLastError(), "CreateEventW");