mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 04:13:24 +00:00
Refactor code related to CPU local memory
Co-authored-by: Chuandong Li <lichuand@pku.edu.cn>
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
98619f3482
commit
0f8d8da372
@ -4,7 +4,7 @@ use alloc::sync::Arc;
|
||||
use core::time::Duration;
|
||||
|
||||
use aster_time::read_monotonic_time;
|
||||
use ostd::{arch::timer::Jiffies, cpu_local, sync::SpinLock, CpuLocal};
|
||||
use ostd::{arch::timer::Jiffies, cpu_local, sync::SpinLock};
|
||||
use paste::paste;
|
||||
use spin::Once;
|
||||
|
||||
@ -215,9 +215,7 @@ macro_rules! define_timer_managers {
|
||||
let clock = paste! {[<$clock_id _INSTANCE>].get().unwrap().clone()};
|
||||
let clock_manager = TimerManager::new(clock);
|
||||
paste! {
|
||||
CpuLocal::borrow_with(&[<$clock_id _MANAGER>], |manager| {
|
||||
manager.call_once(|| clock_manager.clone());
|
||||
});
|
||||
[<$clock_id _MANAGER>].call_once(|| clock_manager.clone());
|
||||
}
|
||||
let callback = move || {
|
||||
clock_manager.process_expired_timers();
|
||||
|
Reference in New Issue
Block a user