pub fn remove(&mut self, task: Rc<RefCell<Task>>) {
		let i = task.borrow().prio.into() as usize;
		//assert!(i < NO_PRIORITIES, "Priority {} is too high", i);

		let mut curr = self.queues[i].head.clone();
		let mut next_curr;

		loop {
			match curr {
				None => {
					break;
				}
				Some(ref curr_task) => {
					if Rc::ptr_eq(&curr_task, &task) {
						let (mut prev, mut next) = {
							let borrowed = curr_task.borrow_mut();
							(borrowed.prev.clone(), borrowed.next.clone())
						};

						match prev {
							Some(ref mut t) => {
								t.borrow_mut().next = next.clone();
							}
							None => {}
						};

						match next {
							Some(ref mut t) => {
								t.borrow_mut().prev = prev.clone();
							}
							None => {}
						};

						break;
					}

					next_curr = curr_task.borrow().next.clone();
				}
			}

			curr = next_curr.clone();
		}

		let new_head = match self.queues[i].head {
			Some(ref curr_task) => {
				if Rc::ptr_eq(&curr_task, &task) {
					true
				} else {
					false
				}
			}
			None => false,
		};

		if new_head == true {
			self.queues[i].head = task.borrow().next.clone();

			if self.queues[i].head.is_none() {
				self.prio_bitmap &= !(1 << i as u64);
			}
		}
	}
/// Remove a specific task from the priority queue.
Remove a specific task from the priority queue.
Remove a specific task from the priority queue .
pub fn remove(&mut self, task: Rc<RefCell<Task>>) {
		let i = task.borrow().prio.into() as usize;
		//assert!(i < NO_PRIORITIES, "Priority {} is too high", i);
		let mut curr = self.queues[i].head.clone();
		let mut next_curr;
		loop {
			match curr {
				None => {
					break;
				}
				Some(ref curr_task) => {
					if Rc::ptr_eq(&curr_task, &task) {
						let (mut prev, mut next) = {
							let borrowed = curr_task.borrow_mut();
							(borrowed.prev.clone(), borrowed.next.clone())
						};
						match prev {
							Some(ref mut t) => {
								t.borrow_mut().next = next.clone();
							}
							None => {}
						};
						match next {
							Some(ref mut t) => {
								t.borrow_mut().prev = prev.clone();
							}
							None => {}
						};
						break;
					}
					next_curr = curr_task.borrow().next.clone();
				}
			}
			curr = next_curr.clone();
		}
		let new_head = match self.queues[i].head {
			Some(ref curr_task) => {
				if Rc::ptr_eq(&curr_task, &task) {
					true
				} else {
					false
				}
			}
			None => false,
		};
		if new_head == true {
			self.queues[i].head = task.borrow().next.clone();
			if self.queues[i].head.is_none() {
				self.prio_bitmap &= !(1 << i as u64);
			}
		}
	}
pub fn remove ( & mut self , task : Rc < RefCell < Task > > ) { let i = task . borrow ( ) . prio . into ( ) as usize ; //assert!(i < NO_PRIORITIES, "Priority {} is too high", i); let mut curr = self . queues [ i ] . head . clone ( ) ; let mut next_curr ; loop { match curr { None => { break ; } Some ( ref curr_task ) => { if Rc :: ptr_eq ( & curr_task , & task ) { let ( mut prev , mut next ) = { let borrowed = curr_task . borrow_mut ( ) ; ( borrowed . prev . clone ( ) , borrowed . next . clone ( ) ) } ; match prev { Some ( ref mut t ) => { t . borrow_mut ( ) . next = next . clone ( ) ; } None => { } } ; match next { Some ( ref mut t ) => { t . borrow_mut ( ) . prev = prev . clone ( ) ; } None => { } } ; break ; } next_curr = curr_task . borrow ( ) . next . clone ( ) ; } } curr = next_curr . clone ( ) ; } let new_head = match self . queues [ i ] . head { Some ( ref curr_task ) => { if Rc :: ptr_eq ( & curr_task , & task ) { true } else { false } } None => false , } ; if new_head == true { self . queues [ i ] . head = task . borrow ( ) . next . clone ( ) ; if self . queues [ i ] . head . is_none ( ) { self . prio_bitmap &= ! ( 1 << i as u64 ) ; } } }
Remove a specific task from the priority queue.
Remove a specific task from the priority queue .
&mut self
task
Rc<RefCell<Task>>
&mut self
task
Rc<RefCell<Task>>