Function with_thread_self

Source
pub fn with_thread_self<F, R>(f: F) -> R
where F: for<'a> FnOnce(&Thread) -> R,
Expand description

Provides temporary scoped access to the current thread’s handle.

Callers who need to store a thread handle or to send it to another thread should duplicate the handle to ensure it can outlive the current thread.