diff options
| author | joboet <jonasboettiger@icloud.com> | 2024-03-31 11:28:24 +0200 |
|---|---|---|
| committer | joboet <jonasboettiger@icloud.com> | 2024-03-31 11:28:24 +0200 |
| commit | 76684181018640df1769604cd92ed6beb30a27d6 (patch) | |
| tree | 3acae87f5ed8d387c023f5ea8fd83f4854df1cb5 /library/std/src/sys/sync/rwlock | |
| parent | 5b9d7ab558fe6ee53bd40e16a20c25716f3c9e56 (diff) | |
| download | rust-76684181018640df1769604cd92ed6beb30a27d6.tar.gz rust-76684181018640df1769604cd92ed6beb30a27d6.zip | |
std: move `thread::current` TLS variable out of `thread_info`
Diffstat (limited to 'library/std/src/sys/sync/rwlock')
| -rw-r--r-- | library/std/src/sys/sync/rwlock/queue.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/library/std/src/sys/sync/rwlock/queue.rs b/library/std/src/sys/sync/rwlock/queue.rs index dce966086b8..d1918855797 100644 --- a/library/std/src/sys/sync/rwlock/queue.rs +++ b/library/std/src/sys/sync/rwlock/queue.rs @@ -115,8 +115,7 @@ use crate::sync::atomic::{ AtomicBool, AtomicPtr, Ordering::{AcqRel, Acquire, Relaxed, Release}, }; -use crate::sys_common::thread_info; -use crate::thread::Thread; +use crate::thread::{self, Thread}; // Locking uses exponential backoff. `SPIN_COUNT` indicates how many times the // locking operation will be retried. @@ -203,8 +202,7 @@ impl Node { fn prepare(&mut self) { // Fall back to creating an unnamed `Thread` handle to allow locking in // TLS destructors. - self.thread - .get_or_init(|| thread_info::current_thread().unwrap_or_else(|| Thread::new(None))); + self.thread.get_or_init(|| thread::try_current().unwrap_or_else(|| Thread::new(None))); self.completed = AtomicBool::new(false); } |
