1
- From 0c7406a33e3a40427760e6955188be193fd568a8 Mon Sep 17 00:00:00 2001
1
+ From 9e8b8114de61ecdbf39f7582d7a3280ef2bfd339 Mon Sep 17 00:00:00 2001
2
2
3
- Date: Fri, 1 Mar 2019 18:36:22 +0100
3
+ Date: Sun, 23 Jun 2019 10:37:53 +0200
4
4
Subject: [PATCH] Don't use OS TLS
5
5
6
6
---
@@ -9,13 +9,13 @@ Subject: [PATCH] Don't use OS TLS
9
9
2 files changed, 2 insertions(+), 3 deletions(-)
10
10
11
11
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
12
- index d1f5373..ce83b3b 100644
12
+ index 9b355aa..a074aa5 100644
13
13
--- a/src/libstd/thread/local.rs
14
14
+++ b/src/libstd/thread/local.rs
15
- @@ -164 ,10 +164 ,10 @@ macro_rules! __thread_local_inner {
16
- &'static $crate::cell::UnsafeCell<
17
- $crate::option::Option<$t>>>
18
- {
15
+ @@ -154 ,10 +154 ,10 @@ macro_rules! __thread_local_inner {
16
+ fn __init() -> $t { $init }
17
+
18
+ unsafe fn __getit() -> $crate::option::Option<&'static $t> {
19
19
- #[cfg(all(target_arch = "wasm32", not(target_feature = "atomics")))]
20
20
static __KEY: $crate::thread::__StaticLocalKeyInner<$t> =
21
21
$crate::thread::__StaticLocalKeyInner::new();
@@ -24,24 +24,24 @@ index d1f5373..ce83b3b 100644
24
24
#[thread_local]
25
25
#[cfg(all(
26
26
target_thread_local,
27
- @@ -182 ,6 +182 ,7 @@ macro_rules! __thread_local_inner {
27
+ @@ -172 ,6 +172 ,7 @@ macro_rules! __thread_local_inner {
28
28
))]
29
29
static __KEY: $crate::thread::__OsLocalKeyInner<$t> =
30
30
$crate::thread::__OsLocalKeyInner::new();
31
31
+ */
32
32
33
- __KEY.get()
33
+ __KEY.get(__init )
34
34
}
35
- @@ -308 ,7 +309 ,6 @@ impl<T: 'static> LocalKey<T> {
35
+ @@ -320 ,7 +321 ,6 @@ mod lazy {
36
36
/// On some platforms like wasm32 there's no threads, so no need to generate
37
37
/// thread locals and we can instead just use plain statics!
38
38
#[doc(hidden)]
39
39
- #[cfg(all(target_arch = "wasm32", not(target_feature = "atomics")))]
40
40
pub mod statik {
41
- use crate::cell::UnsafeCell ;
41
+ use super::lazy::LazyKeyInner ;
42
42
use crate::fmt;
43
43
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
44
- index 08f0aa2..eff3126 100644
44
+ index 35de4f4..f142646 100644
45
45
--- a/src/libstd/thread/mod.rs
46
46
+++ b/src/libstd/thread/mod.rs
47
47
@@ -195,7 +195,6 @@ pub use self::local::{LocalKey, AccessError};
@@ -53,4 +53,5 @@ index 08f0aa2..eff3126 100644
53
53
#[unstable(feature = "libstd_thread_internals", issue = "0")]
54
54
#[cfg(target_thread_local)]
55
55
- -
56
- 2.17.2 (Apple Git-113)
56
+ 2.20.1 (Apple Git-117)
57
+
0 commit comments