Function try_with_current

pub(in ::thread::current) fn try_with_current<F, R>(f: F) -> R
where
    F: FnOnce(Option<&Thread>) -> R,

Gets a reference to the handle of the thread that invokes it, if the handle has been initialized.