1
This commit is contained in:
parent
28274dd028
commit
7cee6d5f61
@ -31,7 +31,7 @@ impl Default for TimerType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct TimerList {
|
struct TimerList {
|
||||||
holder: Rc::<RefCell::<TimerList>>,
|
holder: Rc::<RefCell::<TimerList>>,
|
||||||
wp: Rc::<Rc::<RefCell::<TimerList>>>,
|
wp: Rc::<Rc::<RefCell::<TimerList>>>,
|
||||||
timer_entry: Rc::<RefCell::<crate::ListHead<TimerList>>>,
|
timer_entry: Rc::<RefCell::<crate::ListHead<TimerList>>>,
|
||||||
@ -89,12 +89,12 @@ impl Timer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn new_timer_list(&mut self) -> Rc::<RefCell::<TimerList>> {
|
fn new_timer_list(&mut self) -> Rc::<RefCell::<TimerList>> {
|
||||||
let p: Rc::<RefCell::<TimerList>>;
|
let mut p: Rc::<RefCell::<TimerList>>;
|
||||||
|
if self.free_timer_list.borrow().empty() {
|
||||||
p = self.free_timer_list.borrow().first_entry().upgrade().unwrap();
|
p = self.free_timer_list.borrow().first_entry().upgrade().unwrap();
|
||||||
if Rc::weak_count(&p.borrow().wp) > 0 {
|
if Rc::weak_count(&p.borrow().wp) > 0 {
|
||||||
p.borrow_mut().wp = Rc::new(p.borrow().holder.clone());
|
p.borrow_mut().wp = Rc::new(p.borrow().holder.clone());
|
||||||
}
|
}
|
||||||
if self.free_timer_list.borrow().empty() {
|
|
||||||
} else {
|
} else {
|
||||||
p = Rc::new(RefCell::new(TimerList{
|
p = Rc::new(RefCell::new(TimerList{
|
||||||
holder: Default::default(),
|
holder: Default::default(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user