spawn

Function spawn 

Source
pub fn spawn<T>(
    entry_point: fn(thread_id: Cid, argument_ptr: &'static T) -> !,
    argument_ptr: &'static T,
    priority: RawContextPriority,
    custom_stack_size: Option<NonZero<usize>>,
) -> Result<Cid, ErrorStatus>
Expand description

Spawns a thread as a child of self

§Arguments

  • entry_point: a pointer to the main function of the thread

  • argument_ptr: a pointer to the arguments that will be passed to the thread, this pointer will be based as is,

  • priotrity: the pritority of the thread in the thread queue, will default to the parent’s

§Returns

  • the thread ID of the spawned thread