jyknight wrote:

> It wasn't clear to me initially what the way forward is, but it seems like 
> it's not really feasible to conditionalize each use of `std::mutex` and 
> instead WASI sysroots should provide a single-threaded implementation of 
> synchronization primitives for embeddings which do not spawn threads, rather 
> than placing this burden on code targeting Wasm.

Absolutely. This is, perhaps, a "bug" (enhancement request) for libc++: its 
`_LIBCPP_HAS_NO_THREADS` mode currently deletes the mutex and related types, 
but it should instead make them stubs. (it should continue to delete the thread 
types like it does today.) Alternatively, perhaps it would be good to stub it 
out at the pthread API level, so that C code is also handled.

So, I think it'd be good to get this PR in with only supporting 
WASI-with-threads for now, then return to wasi-without-threads after addressing 
the above.

https://github.com/llvm/llvm-project/pull/92677
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to