From 80e0c80c36fe0da09de6c5a1645c77b128aaf4f6 Mon Sep 17 00:00:00 2001 From: R Date: Tue, 6 Aug 2024 21:13:39 +0100 Subject: [PATCH] Don't invoke notify builtin in single-threaded mode This fixes compatibility with old versions of clang --- libc-top-half/musl/src/internal/pthread_impl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc-top-half/musl/src/internal/pthread_impl.h b/libc-top-half/musl/src/internal/pthread_impl.h index 1e7b9741d..0106ac385 100644 --- a/libc-top-half/musl/src/internal/pthread_impl.h +++ b/libc-top-half/musl/src/internal/pthread_impl.h @@ -186,8 +186,10 @@ static inline void __wake(volatile void *addr, int cnt, int priv) __syscall(SYS_futex, addr, FUTEX_WAKE|priv, cnt) != -ENOSYS || __syscall(SYS_futex, addr, FUTEX_WAKE, cnt); #else +#ifdef _REENTRANT __builtin_wasm_memory_atomic_notify((int*)addr, cnt); #endif +#endif } static inline void __futexwait(volatile void *addr, int val, int priv) {