|
| 1 | +From 1ad7a849f9ff845f676d4625ba71d1060039c0de Mon Sep 17 00:00:00 2001 |
| 2 | + |
| 3 | +Date: Thu, 31 Jan 2019 20:11:56 +0100 |
| 4 | +Subject: [PATCH] Don't use OS TLS |
| 5 | + |
| 6 | +--- |
| 7 | + src/libstd/thread/local.rs | 4 ++-- |
| 8 | + src/libstd/thread/mod.rs | 1 - |
| 9 | + 2 files changed, 2 insertions(+), 3 deletions(-) |
| 10 | + |
| 11 | +diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs |
| 12 | +index 5d2eb5f..39513b6 100644 |
| 13 | +--- a/src/libstd/thread/local.rs |
| 14 | ++++ b/src/libstd/thread/local.rs |
| 15 | +@@ -160,10 +160,10 @@ macro_rules! __thread_local_inner { |
| 16 | + &'static $crate::cell::UnsafeCell< |
| 17 | + $crate::option::Option<$t>>> |
| 18 | + { |
| 19 | +- #[cfg(all(target_arch = "wasm32", not(target_feature = "atomics")))] |
| 20 | + static __KEY: $crate::thread::__StaticLocalKeyInner<$t> = |
| 21 | + $crate::thread::__StaticLocalKeyInner::new(); |
| 22 | + |
| 23 | ++ /* |
| 24 | + #[thread_local] |
| 25 | + #[cfg(all( |
| 26 | + target_thread_local, |
| 27 | +@@ -178,6 +178,7 @@ macro_rules! __thread_local_inner { |
| 28 | + ))] |
| 29 | + static __KEY: $crate::thread::__OsLocalKeyInner<$t> = |
| 30 | + $crate::thread::__OsLocalKeyInner::new(); |
| 31 | ++ */ |
| 32 | + |
| 33 | + __KEY.get() |
| 34 | + } |
| 35 | +@@ -304,7 +305,6 @@ impl<T: 'static> LocalKey<T> { |
| 36 | + /// On some platforms like wasm32 there's no threads, so no need to generate |
| 37 | + /// thread locals and we can instead just use plain statics! |
| 38 | + #[doc(hidden)] |
| 39 | +-#[cfg(all(target_arch = "wasm32", not(target_feature = "atomics")))] |
| 40 | + pub mod statik { |
| 41 | + use cell::UnsafeCell; |
| 42 | + use fmt; |
| 43 | +diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs |
| 44 | +index eb8e0c1..b44d737 100644 |
| 45 | +--- a/src/libstd/thread/mod.rs |
| 46 | ++++ b/src/libstd/thread/mod.rs |
| 47 | +@@ -195,7 +195,6 @@ pub use self::local::{LocalKey, AccessError}; |
| 48 | + // where available, but both are needed. |
| 49 | + |
| 50 | + #[unstable(feature = "libstd_thread_internals", issue = "0")] |
| 51 | +-#[cfg(all(target_arch = "wasm32", not(target_feature = "atomics")))] |
| 52 | + #[doc(hidden)] pub use self::local::statik::Key as __StaticLocalKeyInner; |
| 53 | + #[unstable(feature = "libstd_thread_internals", issue = "0")] |
| 54 | + #[cfg(target_thread_local)] |
| 55 | +-- |
| 56 | +2.11.0 |
| 57 | + |
0 commit comments