pub fn exit(&mut self, exit_code: i32) -> ! {
		{
			// Get the current task.
			let mut current_task_borrowed = self.current_task.borrow_mut();
			assert!(
				current_task_borrowed.status != TaskStatus::TaskIdle,
				"Trying to terminate the idle task"
			);

			// Finish the task and reschedule.
			debug!(
				"Finishing task {} with exit code {}",
				current_task_borrowed.id, exit_code
			);
			current_task_borrowed.status = TaskStatus::TaskFinished;
			NO_TASKS.fetch_sub(1, Ordering::SeqCst);
		}

		self.scheduler();

		// we should never reach this point
		panic!("exit failed!")
	}
/// Terminate the current task on the current core.
Terminate the current task on the current core.
Terminate the current task on the current core .
pub fn exit(&mut self, exit_code: i32) -> ! {
		{
			// Get the current task.
			let mut current_task_borrowed = self.current_task.borrow_mut();
			assert!(
				current_task_borrowed.status != TaskStatus::TaskIdle,
				"Trying to terminate the idle task"
			);
			// Finish the task and reschedule.
			debug!(
				"Finishing task {} with exit code {}",
				current_task_borrowed.id, exit_code
			);
			current_task_borrowed.status = TaskStatus::TaskFinished;
			NO_TASKS.fetch_sub(1, Ordering::SeqCst);
		}
		self.scheduler();
		// we should never reach this point
		panic!("exit failed!")
	}
pub fn exit ( & mut self , exit_code : i32 ) -> ! { { // Get the current task. let mut current_task_borrowed = self . current_task . borrow_mut ( ) ; assert ! ( current_task_borrowed status TaskStatus TaskIdle " " ) ; // Finish the task and reschedule. debug ! ( " " current_task_borrowed id exit_code ) ; current_task_borrowed . status = TaskStatus :: TaskFinished ; NO_TASKS . fetch_sub ( 1 , Ordering :: SeqCst ) ; } self . scheduler ( ) ; // we should never reach this point panic ! ( " " ) }
Terminate the current task on the current core.
Terminate the current task on the current core .
&mut self
exit_code
i32
&mut self
exit_code
i32