From f87e9107f576b8ebc456a95ac1caf096ff560d54 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 7 Oct 2023 22:30:34 +0800 Subject: [PATCH] 1 --- src/timer.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/timer.rs b/src/timer.rs index dee57c9..78851b6 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -1,5 +1,6 @@ use std::rc::{Rc, Weak}; use std::cell::RefCell; +use std::any::Any; const CONFIG_BASE_SMALL: bool = false; const TVN_BITS: usize = 6; @@ -9,8 +10,22 @@ const TVR_SIZE: usize = 1 << TVR_BITS; const TVN_MASK: usize = TVN_SIZE - 1; const TVR_MASK: usize = TVR_SIZE - 1; -pub struct TimerList { +pub type TimerWp = Weak::>>; +pub struct TimerAttacher { + timers: Rc::>>, +} + +struct TimerList { + holder: Rc::>, + wp: Rc::>>, + timer_entry: Rc::>>, + attach_entry: Rc::>>, + timer_type: i8, + expire_time: i32, + expires: i64, + + cb: fn (i32, Option>>), } pub struct Timer {