Function std::thread::scoped
[−]
[src]
pub fn scoped<'a, T, F>(f: F) -> JoinGuard<'a, T> where T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
: memory unsafe if destructor is avoided, see #24292
Spawns a new scoped thread, returning a JoinGuard
`JoinGuard` for it.
The join guard can be used to explicitly join the child thread (via
join
`join), returning
`), returning Result<T>
`Result
Panics
Panics if the OS fails to create a thread; use Builder::scoped
`Builder::scoped`
to recover from such errors.