Implement sleep using blocking & BinaryHeap.
This commit is contained in:
parent
db6a93e60d
commit
c951c1781e
6 changed files with 79 additions and 7 deletions
|
@ -20,7 +20,7 @@ use crate::task::{
|
|||
current_trap_cx,
|
||||
current_trap_cx_user_va,
|
||||
};
|
||||
use crate::timer::set_next_trigger;
|
||||
use crate::timer::{set_next_trigger, check_timer};
|
||||
use crate::config::TRAMPOLINE;
|
||||
|
||||
global_asm!(include_str!("trap.S"));
|
||||
|
@ -83,6 +83,7 @@ pub fn trap_handler() -> ! {
|
|||
}
|
||||
Trap::Interrupt(Interrupt::SupervisorTimer) => {
|
||||
set_next_trigger();
|
||||
check_timer();
|
||||
suspend_current_and_run_next();
|
||||
}
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue