pub fn run(&self) -> ! {
        let inner = self.inner();
        unsafe { interrupt::disable_and_store(); }
        loop {
            if let Some(proc) = inner.manager.run(inner.id) {
                trace!("CPU{} begin running thread {}", inner.id, proc.0);
                inner.proc = Some(proc);
                unsafe {
                    inner.loop_context.switch_to(&mut *inner.proc.as_mut().unwrap().1);
                }
                let (tid, context) = inner.proc.take().unwrap();
                trace!("CPU{} stop running thread {}", inner.id, tid);
                inner.manager.stop(tid, context);
            } else {
                trace!("CPU{} idle", inner.id);
                unsafe { interrupt::enable_and_wfi(); }
                // wait for a timer interrupt
                unsafe { interrupt::disable_and_store(); }
            }
        }
    }
/// Begin running processes after CPU setup.
///
/// This function never returns. It loops, doing:
/// - choose a process to run
/// - switch to start running that process
/// - eventually that process transfers control
///   via switch back to the scheduler.
Begin running processes after CPU setup.
This function never returns. It loops, doing:
choose a process to run
switch to start running that process
eventually that process transfers control
via switch back to the scheduler.
Begin running processes after CPU setup . This function never returns . It loops doing : choose a process to run switch to start running that process eventually that process transfers control via switch back to the scheduler .
pub fn run(&self) -> ! {
        let inner = self.inner();
        unsafe { interrupt::disable_and_store(); }
        loop {
            if let Some(proc) = inner.manager.run(inner.id) {
                trace!("CPU{} begin running thread {}", inner.id, proc.0);
                inner.proc = Some(proc);
                unsafe {
                    inner.loop_context.switch_to(&mut *inner.proc.as_mut().unwrap().1);
                }
                let (tid, context) = inner.proc.take().unwrap();
                trace!("CPU{} stop running thread {}", inner.id, tid);
                inner.manager.stop(tid, context);
            } else {
                trace!("CPU{} idle", inner.id);
                unsafe { interrupt::enable_and_wfi(); }
                // wait for a timer interrupt
                unsafe { interrupt::disable_and_store(); }
            }
        }
    }
pub fn run ( & self ) -> ! { let inner = self . inner ( ) ; unsafe { interrupt :: disable_and_store ( ) ; } loop { if let Some ( proc ) = inner . manager . run ( inner . id ) { trace ! ( " " inner id proc 0 ) ; inner . proc = Some ( proc ) ; unsafe { inner . loop_context . switch_to ( & mut * inner . proc . as_mut ( ) . unwrap ( ) . 1 ) ; } let ( tid , context ) = inner . proc . take ( ) . unwrap ( ) ; trace ! ( " " inner id tid ) ; inner . manager . stop ( tid , context ) ; } else { trace ! ( " " inner id ) ; unsafe { interrupt :: enable_and_wfi ( ) ; } // wait for a timer interrupt unsafe { interrupt :: disable_and_store ( ) ; } } } }
Begin running processes after CPU setup.
Begin running processes after CPU setup .
&self
&self