diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-12-11 12:42:29 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-12-21 22:05:37 -0800 |
| commit | cd74364e5ddd3e81fa27ea149194966a3a172d9b (patch) | |
| tree | d2a50c7c82e12dead2efa2c4797bae2120d08b61 /src/libstd/thread/mod.rs | |
| parent | 617a7af70400c7a3f82fafcb50daf01f01db95a0 (diff) | |
| download | rust-cd74364e5ddd3e81fa27ea149194966a3a172d9b.tar.gz rust-cd74364e5ddd3e81fa27ea149194966a3a172d9b.zip | |
std: Use cfg(target_thread_local) in thread_local!
This transitions the standard library's `thread_local!` macro to use the freshly-added and gated `#[cfg(target_thread_local)]` attribute. This greatly simplifies the `#[cfg]` logic in play here, but requires that the standard library expose both the OS and ELF TLS implementation modules as unstable implementation details. The implementation details were shuffled around a bit but end up generally compiling to the same thing. Closes #26581 (this supersedes the need for the option) Closes #27057 (this also starts ignoring the option)
Diffstat (limited to 'src/libstd/thread/mod.rs')
| -rw-r--r-- | src/libstd/thread/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index d4f04d5d94f..0e525f39421 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -191,7 +191,10 @@ pub use self::local::{LocalKey, LocalKeyState}; pub use self::scoped_tls::ScopedKey; #[unstable(feature = "libstd_thread_internals", issue = "0")] -#[doc(hidden)] pub use self::local::__KeyInner as __LocalKeyInner; +#[cfg(target_thread_local)] +#[doc(hidden)] pub use self::local::elf::Key as __ElfLocalKeyInner; +#[unstable(feature = "libstd_thread_internals", issue = "0")] +#[doc(hidden)] pub use self::local::os::Key as __OsLocalKeyInner; #[unstable(feature = "libstd_thread_internals", issue = "0")] #[doc(hidden)] pub use self::scoped_tls::__KeyInner as __ScopedKeyInner; |
