Function spawn2

Source
pub fn spawn2(
    entry_point: fn(thread_id: Cid, argument: usize) -> !,
    argument: usize,
    priority: Option<ContextPriority>,
) -> Result<Cid, ErrorStatus>
Expand description

Spawns a thread as a child of self unlike spawn, instead of taking a reference as an argument to pass to the thread, this will take a usize

§Arguments

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

  • argument: a usize argument that will be passed to the thread

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

§Returns

  • the thread ID of the spawned thread