1
This commit is contained in:
parent
28d9f032e2
commit
a7e0c032f6
@ -2,6 +2,8 @@ use std::rc::{Rc, Weak};
|
|||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use r9_macro::SharedFromSelf;
|
use r9_macro::SharedFromSelf;
|
||||||
use r9_macro_derive::SharedFromSelf;
|
use r9_macro_derive::SharedFromSelf;
|
||||||
|
|
||||||
@ -307,9 +309,7 @@ impl XTimer {
|
|||||||
expire_time: i32,
|
expire_time: i32,
|
||||||
cb: TimerCb,
|
cb: TimerCb,
|
||||||
attacher: Option<XTimerAttacherRp>) -> XTimerWp {
|
attacher: Option<XTimerAttacherRp>) -> XTimerWp {
|
||||||
println!("2222");
|
|
||||||
let t = self.new_timer_list();
|
let t = self.new_timer_list();
|
||||||
println!("111111");
|
|
||||||
t.borrow_mut().cb = Some(cb);
|
t.borrow_mut().cb = Some(cb);
|
||||||
t.borrow_mut().timer_type = timer_type;
|
t.borrow_mut().timer_type = timer_type;
|
||||||
t.borrow_mut().expire_time = expire_time;
|
t.borrow_mut().expire_time = expire_time;
|
||||||
@ -358,7 +358,6 @@ impl XTimer {
|
|||||||
index = (t.borrow().expires >> (TVR_BITS + 3 * TVN_BITS)) & (TVN_MASK as i64);
|
index = (t.borrow().expires >> (TVR_BITS + 3 * TVN_BITS)) & (TVN_MASK as i64);
|
||||||
vec = &self.tv5[index as usize];
|
vec = &self.tv5[index as usize];
|
||||||
}
|
}
|
||||||
println!("add2 idx:{} index:{}", idx, index);
|
|
||||||
crate::ListHead::<TimerList>::add_tail(&vec, &t.borrow_mut().timer_entry);
|
crate::ListHead::<TimerList>::add_tail(&vec, &t.borrow_mut().timer_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -514,7 +513,8 @@ impl XTimer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn gc_timer(&mut self, e: TimerEvent, _args: Option<Vec<Rc::<dyn Any>>>) {
|
fn gc_timer(&mut self, e: TimerEvent, _args: Option<Vec<Rc::<dyn Any>>>) {
|
||||||
println!("aaaaa");
|
let now = Instant::now();
|
||||||
|
println!("now: {:?}", now);
|
||||||
match e {
|
match e {
|
||||||
TimerEvent::Exec => {
|
TimerEvent::Exec => {
|
||||||
while self.free_timer_num > self.cache_timer_num &&
|
while self.free_timer_num > self.cache_timer_num &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user