File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 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::{
44 Ordering :: { Acquire , Relaxed , Release } ,
55} ;
66use crate :: sys:: futex:: { futex_wait, futex_wake, futex_wake_all} ;
7- use crate :: sys_common:: thread_info:: current_thread_unique_ptr;
87use crate :: time:: Duration ;
98
109pub type MovableMutex = Mutex ;
@@ -248,3 +247,12 @@ impl ReentrantMutex {
248247 }
249248 }
250249}
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 {
3030 }
3131}
3232
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-
4233pub fn current_thread ( ) -> Option < Thread > {
4334 ThreadInfo :: with ( |info| info. thread . clone ( ) )
4435}
You can’t perform that action at this time.
0 commit comments