diff --git a/src/listhead.rs b/src/listhead.rs index d2e4426..e1c3802 100644 --- a/src/listhead.rs +++ b/src/listhead.rs @@ -60,8 +60,8 @@ impl ListHead { return self as *const ListHead == self.next.upgrade().unwrap().as_ptr(); } - pub fn add_tail(head: &mut Rc::>>, - pnew: &mut Rc::>>) { + pub fn add_tail(head: &Rc::>>, + pnew: &Rc::>>) { let prev = &mut head.borrow_mut().prev; let next = Rc::downgrade(head); diff --git a/src/timer.rs b/src/timer.rs index da09b94..ea3b881 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -13,7 +13,7 @@ const TVR_MASK: usize = TVR_SIZE - 1; pub type TimerWp = Weak::>>; pub struct TimerAttacher { - timers: Rc::>>, + timers: Rc::>>, } enum TimerType { @@ -132,7 +132,8 @@ impl Timer { t.borrow_mut().expires = (self.get_tick_count)() + expire_time as i64; match attacher { Some(v) => { - + crate::ListHead::add_tail(&v.borrow_mut().timers, + &t.borrow_mut().attach_entry); } None => {