Auto merge of #126523 - joboet:the_great_big_tls_refactor, r=Mark-Sim… · model-checking/verify-rust-std@e51d8a2 (original) (raw)
49 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -32,9 +32,6 @@ pub mod pipe; | ||
32 | 32 | pub mod process; |
33 | 33 | pub mod stdio; |
34 | 34 | pub mod thread; |
35 | -pub mod thread_local_dtor; | |
36 | -#[path = "../unsupported/thread_local_key.rs"] | |
37 | -pub mod thread_local_key; | |
38 | 35 | pub mod time; |
39 | 36 | |
40 | 37 | use crate::io::ErrorKind; |
@@ -97,7 +94,6 @@ pub unsafe extern "C" fn runtime_entry( | ||
97 | 94 | argv: *const *const c_char, |
98 | 95 | env: *const *const c_char, |
99 | 96 | ) -> ! { |
100 | -use thread_local_dtor::run_dtors; | |
101 | 97 | extern "C" { |
102 | 98 | fn main(argc: isize, argv: *const *const c_char) -> i32; |
103 | 99 | } |
@@ -107,7 +103,7 @@ pub unsafe extern "C" fn runtime_entry( | ||
107 | 103 | |
108 | 104 | let result = main(argc as isize, argv); |
109 | 105 | |
110 | -run_dtors(); | |
106 | +crate::sys::thread_local::destructors::run(); | |
111 | 107 | hermit_abi::exit(result); |
112 | 108 | } |
113 | 109 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
1 | 1 | #![allow(dead_code)] |
2 | 2 | |
3 | 3 | use super::hermit_abi; |
4 | -use super::thread_local_dtor::run_dtors; | |
5 | 4 | use crate::ffi::CStr; |
6 | 5 | use crate::io; |
7 | 6 | use crate::mem; |
@@ -50,7 +49,7 @@ impl Thread { | ||
50 | 49 | Box::from_raw(ptr::with_exposed_provenance::<Box<dyn FnOnce()>>(main).cast_mut())(); |
51 | 50 | |
52 | 51 | // run all destructors |
53 | -run_dtors(); | |
52 | +crate::sys::thread_local::destructors::run(); | |
54 | 53 | } |
55 | 54 | } |
56 | 55 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -15,7 +15,6 @@ use crate::{ | ||
15 | 15 | num::NonZero, |
16 | 16 | ptr::NonNull, |
17 | 17 | sync::atomic::{AtomicUsize, Ordering}, |
18 | - sys::thread_local_dtor::run_dtors, | |
19 | 18 | time::Duration, |
20 | 19 | }; |
21 | 20 | |
@@ -117,7 +116,7 @@ impl Thread { | ||
117 | 116 | |
118 | 117 | // Run TLS destructors now because they are not |
119 | 118 | // called automatically for terminated tasks. |
120 | -unsafe { run_dtors() }; | |
119 | +unsafe { crate::sys::thread_local::destructors::run() }; | |
121 | 120 | |
122 | 121 | let old_lifecycle = inner |
123 | 122 | .lifecycle |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -26,7 +26,6 @@ pub mod pipe; | ||
26 | 26 | pub mod process; |
27 | 27 | pub mod stdio; |
28 | 28 | pub mod thread; |
29 | -pub mod thread_local_key; | |
30 | 29 | pub mod thread_parking; |
31 | 30 | pub mod time; |
32 | 31 | pub mod waitqueue; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -33,8 +33,6 @@ pub mod pipe; | ||
33 | 33 | pub mod process; |
34 | 34 | pub mod stdio; |
35 | 35 | pub use self::itron::thread; |
36 | -pub mod thread_local_dtor; | |
37 | -pub mod thread_local_key; | |
38 | 36 | pub use self::itron::thread_parking; |
39 | 37 | pub mod time; |
40 | 38 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -27,9 +27,6 @@ pub mod process; | ||
27 | 27 | mod rand; |
28 | 28 | pub mod stdio; |
29 | 29 | pub mod thread; |
30 | -pub mod thread_local_dtor; | |
31 | -#[path = "../unix/thread_local_key.rs"] | |
32 | -pub mod thread_local_key; | |
33 | 30 | #[allow(non_upper_case_globals)] |
34 | 31 | #[path = "../unix/time.rs"] |
35 | 32 | pub mod time; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -28,8 +28,6 @@ pub mod pipe; | ||
28 | 28 | pub mod process; |
29 | 29 | pub mod stdio; |
30 | 30 | pub mod thread; |
31 | -#[path = "../unsupported/thread_local_key.rs"] | |
32 | -pub mod thread_local_key; | |
33 | 31 | pub mod time; |
34 | 32 | |
35 | 33 | mod helpers; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -33,8 +33,6 @@ pub mod rand; | ||
33 | 33 | pub mod stack_overflow; |
34 | 34 | pub mod stdio; |
35 | 35 | pub mod thread; |
36 | -pub mod thread_local_dtor; | |
37 | -pub mod thread_local_key; | |
38 | 36 | pub mod thread_parking; |
39 | 37 | pub mod time; |
40 | 38 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -11,9 +11,6 @@ pub mod pipe; | ||
11 | 11 | pub mod process; |
12 | 12 | pub mod stdio; |
13 | 13 | pub mod thread; |
14 | -#[cfg(target_thread_local)] | |
15 | -pub mod thread_local_dtor; | |
16 | -pub mod thread_local_key; | |
17 | 14 | pub mod time; |
18 | 15 | |
19 | 16 | mod common; |