fn cleanup_tasks(&mut self) {
		// Pop the first finished task and remove it from the TASKS list, which implicitly deallocates all associated memory.
		if let Some(id) = self.finished_tasks.pop_front() {
			debug!("Cleaning up task {}", id);

			let task = unsafe { TASKS.as_ref().unwrap().lock().remove(&id) };
			// wakeup tasks, which are waiting for task with the identifier id
			match task {
				Some(t) => t.borrow().wakeup.lock().wakeup_all(),
				None => {}
			}
		}
	}
/// Check if a finished task could be deleted.
Check if a finished task could be deleted.
Check if a finished task could be deleted .
fn cleanup_tasks(&mut self) {
		// Pop the first finished task and remove it from the TASKS list, which implicitly deallocates all associated memory.
		if let Some(id) = self.finished_tasks.pop_front() {
			debug!("Cleaning up task {}", id);
			let task = unsafe { TASKS.as_ref().unwrap().lock().remove(&id) };
			// wakeup tasks, which are waiting for task with the identifier id
			match task {
				Some(t) => t.borrow().wakeup.lock().wakeup_all(),
				None => {}
			}
		}
	}
fn cleanup_tasks ( & mut self ) { // Pop the first finished task and remove it from the TASKS list, which implicitly deallocates all associated memory. if let Some ( id ) = self . finished_tasks . pop_front ( ) { debug ! ( " " id ) ; let task = unsafe { TASKS . as_ref ( ) . unwrap ( ) . lock ( ) . remove ( & id ) } ; // wakeup tasks, which are waiting for task with the identifier id match task { Some ( t ) => t . borrow ( ) . wakeup . lock ( ) . wakeup_all ( ) , None => { } } } }
Check if a finished task could be deleted.
Check if a finished task could be deleted .
&mut self
&mut self