Still a lot of bugs :(
This commit is contained in:
parent
704eae3bb0
commit
26f44233f6
27 changed files with 308 additions and 95 deletions
|
@ -2,7 +2,7 @@ use core::cmp::Ordering;
|
|||
|
||||
use crate::config::CLOCK_FREQ;
|
||||
use crate::sbi::set_timer;
|
||||
use crate::sync::UPSafeCell;
|
||||
use crate::sync::UPIntrFreeCell;
|
||||
use crate::task::{add_task, TaskControlBlock};
|
||||
use alloc::collections::BinaryHeap;
|
||||
use alloc::sync::Arc;
|
||||
|
@ -50,8 +50,8 @@ impl Ord for TimerCondVar {
|
|||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref TIMERS: UPSafeCell<BinaryHeap<TimerCondVar>> =
|
||||
unsafe { UPSafeCell::new(BinaryHeap::<TimerCondVar>::new()) };
|
||||
static ref TIMERS: UPIntrFreeCell<BinaryHeap<TimerCondVar>> =
|
||||
unsafe { UPIntrFreeCell::new(BinaryHeap::<TimerCondVar>::new()) };
|
||||
}
|
||||
|
||||
pub fn add_timer(expire_ms: usize, task: Arc<TaskControlBlock>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue