Skip to main content

spawn_named

Function spawn_named 

Source
pub fn spawn_named<F, T, N: Into<String>>(name: N, f: F) -> JoinHandle<T>
where F: FnOnce() -> T + Send + 'static, T: Send + 'static,
Expand description

Spawn a new named thread.

Sets the OS thread name and tracks the thread in active_named_thread_count. The counter is decremented automatically when f returns.

ยงPanics

Panics if the OS refuses to create the thread.