avoid unnecessary Thread
handle allocation
This commit is contained in:
parent
280cbc5dae
commit
709ccf98b8
@ -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…
x
Reference in New Issue
Block a user