avoid unnecessary Thread handle allocation
This commit is contained in:
parent
280cbc5dae
commit
709ccf98b8
1 changed files with 2 additions and 1 deletions
|
|
@ -210,7 +210,8 @@ 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(Thread::new(None)));
|
||||
self.thread
|
||||
.get_or_init(|| thread_info::current_thread().unwrap_or_else(|| Thread::new(None)));
|
||||
self.completed = AtomicBool::new(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue