mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-30 11:03:58 +00:00
Timeout list should be accessed with IRQ disabled
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
232888982c
commit
9e09196043
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user