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

		self.prio_bitmap |= 1 << i;
		match self.queues[i].tail {
			None => {
				// first element in the queue
				self.queues[i].head = Some(task.clone());

				let mut borrow = task.borrow_mut();
				borrow.next = None;
				borrow.prev = None;
			}
			Some(ref mut tail) => {
				// add task at the end of the node
				tail.borrow_mut().next = Some(task.clone());

				let mut borrow = task.borrow_mut();
				borrow.next = None;
				borrow.prev = Some(tail.clone());
			}
		}

		self.queues[i].tail = Some(task.clone());
	}
/// Add a task by its priority to the queue
Add a task by its priority to the queue
Add a task by its priority to the queue
pub fn push(&mut self, task: Rc<RefCell<Task>>) {
		let i = task.borrow().prio.into() as usize;
		//assert!(i < NO_PRIORITIES, "Priority {} is too high", i);
		self.prio_bitmap |= 1 << i;
		match self.queues[i].tail {
			None => {
				// first element in the queue
				self.queues[i].head = Some(task.clone());
				let mut borrow = task.borrow_mut();
				borrow.next = None;
				borrow.prev = None;
			}
			Some(ref mut tail) => {
				// add task at the end of the node
				tail.borrow_mut().next = Some(task.clone());
				let mut borrow = task.borrow_mut();
				borrow.next = None;
				borrow.prev = Some(tail.clone());
			}
		}
		self.queues[i].tail = Some(task.clone());
	}
pub fn push ( & mut self , task : Rc < RefCell < Task > > ) { let i = task . borrow ( ) . prio . into ( ) as usize ; //assert!(i < NO_PRIORITIES, "Priority {} is too high", i); self . prio_bitmap |= 1 << i ; match self . queues [ i ] . tail { None => { // first element in the queue self . queues [ i ] . head = Some ( task . clone ( ) ) ; let mut borrow = task . borrow_mut ( ) ; borrow . next = None ; borrow . prev = None ; } Some ( ref mut tail ) => { // add task at the end of the node tail . borrow_mut ( ) . next = Some ( task . clone ( ) ) ; let mut borrow = task . borrow_mut ( ) ; borrow . next = None ; borrow . prev = Some ( tail . clone ( ) ) ; } } self . queues [ i ] . tail = Some ( task . clone ( ) ) ; }
Add a task by its priority to the queue
Add a task by its priority to the queue
&mut self
task
Rc<RefCell<Task>>
&mut self
task
Rc<RefCell<Task>>