Method lrs::thread::Builder::scoped

Spawns a new scoped thread.

Syntax

impl Builder {
    fn scoped<'a, F>(self, 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.