]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #78965 - jryans:emscripten-threads-libc, r=kennytm
authorbors <bors@rust-lang.org>
Thu, 12 Nov 2020 05:52:17 +0000 (05:52 +0000)
committerbors <bors@rust-lang.org>
Thu, 12 Nov 2020 05:52:17 +0000 (05:52 +0000)
Update thread and futex APIs to work with Emscripten

This updates the thread and futex APIs in `std` to match the APIs exposed by
Emscripten. This allows threads to run on `wasm32-unknown-emscripten` and the
thread parker to compile without errors related to the missing `futex` module.

To make use of this, Rust code must be compiled with `-C target-feature=atomics`
and Emscripten must link with `-pthread`.

I have confirmed this works well locally when building multithreaded crates.
Attempting to enable `std` thread tests currently fails for seemingly obscure
reasons and Emscripten is currently disabled in CI, so further work is needed to
have proper test coverage here.

1  2 
library/std/src/sys/unix/thread.rs

Simple merge