referrerpolicy=no-referrer-when-downgrade

spawn_worker_thread

Function spawn_worker_thread 

Source
pub fn spawn_worker_thread<F, R>(
    name: &str,
    f: F,
    cond: Cond,
    outcome: WaitOutcome,
) -> Result<JoinHandle<R>>
where F: FnOnce() -> R + Send + 'static + UnwindSafe, R: Send + 'static,
Expand description

Runs a worker thread. Will run the requested function, and afterwards notify the threads waiting on the condvar. Catches panics during execution and resumes the panics after triggering the condvar, so that the waiting thread is notified on panics.

§Returns

Returns the thread’s join handle. Calling .join() on it returns the result of executing f(), as well as whether we were able to enable sandboxing.