Function lrs::thread::scoped

Spawns a new scoped thread.

Syntax

fn scoped<'a, F>(f: F) -> Result<JoinGuard<'a>, Errno>
    where F: FnOnce() -> () + Send + 'a,

Arguments

NameDescription
f

The closure that will be run in the new thread.

Remarks

The thread will automatically be joined when the guard's destructor runs.