Files
Yuta Saito c8b8cc9cd8 [wasm][Synchronization] Use busywait when wasi-libc's busywait mode is opted in
When Swift runs on wasm32-unknown-wasip1-threads in a web browser,
WebAssembly waiting instructions cannot be used on the main thread.
However, Synchronization mutex locking currently assumes it may block in
that situation, which makes contended locking fail in browser hosts when
it reaches `llvm.wasm.memory.atomic.wait32`. (you will see
`Atomics.wait cannot be called in this context`)

wasi-libc has an opt-in mode that makes futex wait on a thread to use
busywait instead of `atomic.wait32`. This change adopts the same model
by referencing the same opt-in flag.

See: WebAssembly/wasi-libc#562.
2026-06-10 12:41:43 +00:00
..
2025-04-08 16:07:54 -07:00