pub fn thread_fn<F, T>( f: F, switch_before_exit: bool, result: Arc<Mutex<Option<Result<T>>>>, )where F: FnOnce() -> T,
The body of a spawned thread. Runs f, drops thread locals, publishes result.
f