std: Switch implementations of thread_local! for WASI#159733
Open
alexcrichton wants to merge 1 commit into
Open
std: Switch implementations of thread_local! for WASI#159733alexcrichton wants to merge 1 commit into
thread_local! for WASI#159733alexcrichton wants to merge 1 commit into
Conversation
This commit is a change for all WASI targets to use a different underlying implementation in the standard library for `thread_local!`. Previously all wasm targets, without the `atomics` feature, were funneled into the `no_threads` implementation and various fallbacks in the `thread_local` module. The upcoming `wasm32-wasip3` target, however, will actually have threads and will need different treatment. Additionally the modules that `wasm32-wasip3` needs all already work on all other WASI targets as well -- for example the `pthread_*` symbols needed to manage destructors are exposed by `wasi-libc`. The end result is that the `wasm32-wasip3` target will be "ready for threads" as soon as `wasi-libc` has support. Other targets shouldn't have any functional difference from before, too.
Collaborator
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit is a change for all WASI targets to use a different underlying implementation in the standard library for
thread_local!. Previously all wasm targets, without theatomicsfeature, were funneled into theno_threadsimplementation and various fallbacks in thethread_localmodule. The upcomingwasm32-wasip3target, however, will actually have threads and will need different treatment. Additionally the modules thatwasm32-wasip3needs all already work on all other WASI targets as well -- for example thepthread_*symbols needed to manage destructors are exposed bywasi-libc.The end result is that the
wasm32-wasip3target will be "ready for threads" as soon aswasi-libchas support. Other targets shouldn't have any functional difference from before, too.