File tree 2 files changed +9
-10
lines changed
2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ use crate::sync::atomic::{
4
4
Ordering :: { Acquire , Relaxed , Release } ,
5
5
} ;
6
6
use crate :: sys:: futex:: { futex_wait, futex_wake, futex_wake_all} ;
7
- use crate :: sys_common:: thread_info:: current_thread_unique_ptr;
8
7
use crate :: time:: Duration ;
9
8
10
9
pub type MovableMutex = Mutex ;
@@ -248,3 +247,12 @@ impl ReentrantMutex {
248
247
}
249
248
}
250
249
}
250
+
251
+ /// Get an address that is unique per running thread.
252
+ ///
253
+ /// This can be used as a non-null usize-sized ID.
254
+ pub fn current_thread_unique_ptr ( ) -> usize {
255
+ // Use a non-drop type to make sure it's still available during thread destruction.
256
+ thread_local ! { static X : u8 = 0 }
257
+ X . with ( |x| <* const _ >:: addr ( x) )
258
+ }
Original file line number Diff line number Diff line change @@ -30,15 +30,6 @@ impl ThreadInfo {
30
30
}
31
31
}
32
32
33
- /// Get an address that is unique per running thread.
34
- ///
35
- /// This can be used as a non-null usize-sized ID.
36
- pub fn current_thread_unique_ptr ( ) -> usize {
37
- // Use a non-drop type to make sure it's still available during thread destruction.
38
- thread_local ! { static X : u8 = 0 }
39
- X . with ( |x| <* const _ >:: addr ( x) )
40
- }
41
-
42
33
pub fn current_thread ( ) -> Option < Thread > {
43
34
ThreadInfo :: with ( |info| info. thread . clone ( ) )
44
35
}
You can’t perform that action at this time.
0 commit comments