mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 04:13:24 +00:00
Refactor the implementation
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
50761a5cc5
commit
0d6f6f001c
@ -60,7 +60,7 @@ impl Timer {
|
||||
let mut lock = self.inner.lock_irq_disabled();
|
||||
match &lock.timer_callback {
|
||||
Some(callback) => {
|
||||
callback.disable();
|
||||
callback.cancel();
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
@ -94,7 +94,7 @@ impl Timer {
|
||||
pub fn clear(&self) {
|
||||
let mut lock = self.inner.lock_irq_disabled();
|
||||
if let Some(callback) = &lock.timer_callback {
|
||||
callback.disable();
|
||||
callback.cancel();
|
||||
}
|
||||
lock.timeout_tick = 0;
|
||||
lock.start_tick = 0;
|
||||
|
Reference in New Issue
Block a user