Skip to content

Commit a9c0a5b

Browse files
committed
gh-108724: Fix _PySemaphore compile error on WASM
Some WASM platforms have POSIX semaphores, but not sem_timedwait.
1 parent 0c89056 commit a9c0a5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Include/internal/pycore_semaphore.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
# error "Require native threads. See https://bugs.python.org/issue31370"
2121
#endif
2222

23-
#if defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES+0) != -1
23+
#if (defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES+0) != -1 && \
24+
defined(HAVE_SEM_TIMEDWAIT))
2425
# define _Py_USE_SEMAPHORES
2526
# include <semaphore.h>
2627
#endif

0 commit comments

Comments
 (0)