pub fn add(&self, mut context: Box<Context>) -> Tid {
        let (tid, mut thread) = self.alloc_tid();
        context.set_tid(tid);
        *thread = Some(Thread {
            status: Status::Ready,
            status_after_stop: Status::Ready,
            waiter: None,
            context: Some(context),
        });
        self.scheduler.push(tid);
        tid
    }
/// Add a new thread
/// Calls action with tid and thread context
Add a new thread
Calls action with tid and thread context
Add a new thread Calls action with tid and thread context
pub fn add(&self, mut context: Box<Context>) -> Tid {
        let (tid, mut thread) = self.alloc_tid();
        context.set_tid(tid);
        *thread = Some(Thread {
            status: Status::Ready,
            status_after_stop: Status::Ready,
            waiter: None,
            context: Some(context),
        });
        self.scheduler.push(tid);
        tid
    }
pub fn add ( & self , mut context : Box < Context > ) -> Tid { let ( tid , mut thread ) = self . alloc_tid ( ) ; context . set_tid ( tid ) ; * thread = Some ( Thread { status : Status :: Ready , status_after_stop : Status :: Ready , waiter : None , context : Some ( context ) , } ) ; self . scheduler . push ( tid ) ; tid }
Add a new thread
Calls action with tid and thread context
Add a new thread Calls action with tid and thread context
&self
context
Box<Context>
&self
context
Box<Context>