diff --git a/src/timer.rs b/src/timer.rs index a0f3c97..d25cd34 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -14,6 +14,7 @@ pub type TimerWp = Weak::>>; pub type TimerCb = Box::>>)>; type TimerListListHeadRp = Rc::>>; type TimerListRp = Rc::>; +type TimerListWp = Weak::>; pub struct TimerAttacher { timers: TimerListListHeadRp, @@ -48,17 +49,17 @@ pub struct TimerList { pub struct Timer { free_timer_num: i32, - free_timer_list: Rc::>>, - running_timer: Weak::>, + free_timer_list: TimerListListHeadRp, + running_timer: TimerListWp, timer_tick: i64, get_tick_count: fn () -> i64, cache_timer_num: i32, - work_list: Rc::>>, - tv1: [Rc::>>; TVR_SIZE], - tv2: [Rc::>>; TVN_SIZE], - tv3: [Rc::>>; TVN_SIZE], - tv4: [Rc::>>; TVN_SIZE], - tv5: [Rc::>>; TVN_SIZE], + work_list: TimerListListHeadRp, + tv1: [TimerListListHeadRp; TVR_SIZE], + tv2: [TimerListListHeadRp; TVN_SIZE], + tv3: [TimerListListHeadRp; TVN_SIZE], + tv4: [TimerListListHeadRp; TVN_SIZE], + tv5: [TimerListListHeadRp; TVN_SIZE], } impl Timer {