We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8f4cb6 commit c62c8cbCopy full SHA for c62c8cb
library/std/src/sys_common/thread_info.rs
@@ -30,6 +30,13 @@ impl ThreadInfo {
30
}
31
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
+ THREAD_INFO.with(|info| <*const _>::addr(info))
38
+}
39
+
40
pub fn current_thread() -> Option<Thread> {
41
ThreadInfo::with(|info| info.thread.clone())
42
0 commit comments