Timeout list should be accessed with IRQ disabled

This commit is contained in:
Ruihan Li
2023-11-12 22:53:46 +08:00
committed by Tate, Hongliang Tian
parent 232888982c
commit 9e09196043

View File

@ -43,7 +43,7 @@ fn timer_callback(trap_frame: &TrapFrame) {
let callbacks = {
let mut callbacks = Vec::new();
let mut timeout_list = TIMEOUT_LIST.get().unwrap().lock();
let mut timeout_list = TIMEOUT_LIST.get().unwrap().lock_irq_disabled();
while let Some(t) = timeout_list.peek() {
if t.is_cancelled() {
@ -147,7 +147,11 @@ where
Box::new(callback),
);
let arc = Arc::new(timer_callback);
TIMEOUT_LIST.get().unwrap().lock().push(arc.clone());
TIMEOUT_LIST
.get()
.unwrap()
.lock_irq_disabled()
.push(arc.clone());
arc
}