This commit is contained in:
azw 2023-11-09 00:20:53 +00:00
parent 9761c32056
commit a3415fcd42

View File

@ -22,11 +22,11 @@ impl<T> Queue<T> {
return this; return this;
} }
pub fn push(&mut self, node: &Rc::<RefCell::<crate::ListHead<T>>>) { pub fn push(&self, node: &Rc::<RefCell::<crate::ListHead<T>>>) {
crate::ListHead::<T>::add_tail(&self.msg_list, node); crate::ListHead::<T>::add_tail(&self.msg_list, node);
} }
pub fn fetch(&mut self) { pub fn fetch(&self) {
if !self.msg_list.borrow().empty() && if !self.msg_list.borrow().empty() &&
self.work_list.borrow().empty() { self.work_list.borrow().empty() {
crate::ListHead::replace_init(&self.work_list, &self.msg_list); crate::ListHead::replace_init(&self.work_list, &self.msg_list);