pub fn spawn<F, T>(
scheduler: Scheduler,
params: impl IntoSchedParams,
f: F,
) -> JoinHandle<T>Expand description
Spawn a thread with the provided scheduler and params.
Params can either be a SchedParams struct, or an i32 representing the desired priority. This function validates that the priority is between min and max for the scheduler before attempting to set it. It panics if the priority is outside the allowed range or setting the scheduler returns an error code.
This function will panic if the scheduler and priority are not correct or could not be set for any reason (process does not have the correct permissions, the scheduler is not supported on the target, or PREEMPT_RT is not enabled/not supported on this platform).