1
This commit is contained in:
parent
a1589b9773
commit
236d4ea878
@ -204,8 +204,7 @@ impl Timer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_timer_index(&self, index : usize) -> usize {
|
fn get_timer_index(&self, index : usize) -> usize {
|
||||||
return ((self.timer_tick as usize) >> (TVR_BITS + index * TVN_BITS)) &
|
return ((self.timer_tick as usize) >> (TVR_BITS + index * TVN_BITS)) & TVN_MASK;
|
||||||
TVN_MASK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self) {
|
pub fn update(&mut self) {
|
||||||
@ -239,10 +238,11 @@ impl Timer {
|
|||||||
Some(v) => {
|
Some(v) => {
|
||||||
match v.borrow().timer_type {
|
match v.borrow().timer_type {
|
||||||
TimerType::Timeout => {
|
TimerType::Timeout => {
|
||||||
//self.internalDelete
|
self.internal_delete(Rc::downgrade(&v.borrow().wp), false);
|
||||||
}
|
}
|
||||||
TimerType::Interval => {
|
TimerType::Interval => {
|
||||||
//self.internalModify
|
self.modify(Rc::downgrade(&v.borrow().wp),
|
||||||
|
v.borrow().expire_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -251,6 +251,7 @@ impl Timer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.running_timer = Weak::new();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn internal_add(&mut self,
|
fn internal_add(&mut self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user