Skip to content

Commit eae6d65

Browse files
committed
lock: correctly initialise semaphore on Windows
Ensure that we create the semaphore on Windows otherwise we do not get a valid lock.
1 parent c7b03c4 commit eae6d65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/shims/lock.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ _dispatch_thread_event_init(dispatch_thread_event_t dte)
285285
dte->dte_value = 0;
286286
#else
287287
_dispatch_sema4_init(&dte->dte_sema, _DSEMA4_POLICY_FIFO);
288+
#if defined(_WIN32)
289+
_dispatch_sema4_create(&dte->dte_sema, _DSEMA4_POLICY_FIFO);
290+
#endif
288291
#endif
289292
}
290293

0 commit comments

Comments
 (0)