-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Update thread and futex APIs to work with Emscripten #78965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
r? @kennytm (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me otherwise.
@kennytm Thanks for the detailed review, comments should be addressed now. |
@bors r+ |
📌 Commit bf3be09 has been approved by |
☀️ Test successful - checks-actions |
This updates the thread and futex APIs in
std
to match the APIs exposed byEmscripten. This allows threads to run on
wasm32-unknown-emscripten
and thethread 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 obscurereasons and Emscripten is currently disabled in CI, so further work is needed to
have proper test coverage here.