Skip to main content

spawn_scoped_os_thread

Function spawn_scoped_os_thread 

Source
pub fn spawn_scoped_os_thread<'scope, 'env, F, T>(
    scope: &'scope Scope<'scope, 'env>,
    name: &str,
    f: F,
) -> ScopedJoinHandle<'scope, T>
where F: FnOnce() -> T + Send + 'scope, T: Send + 'scope,
Available on not (dst and crate feature fuzz).
Expand description

Spawns a scoped thread on the selected blocking backend.

This is the scoped version of spawn_thread, for use with thread::scope, with the same Tokio context rules: native OS threads enter the captured handle, while DST logical threads share the context entered around the entire [reth_concurrency::sync::Runtime::run] call.