Skip to main content

yield_dead_task

Function yield_dead_task 

Source
pub fn yield_dead_task()
Expand description

Force a context switch away from the current task, unconditionally.

Unlike yield_task, this function ignores the preemption guard. It must only be called from super::task_ops::exit_current_task after:

  1. The task has been marked TaskState::Dead.
  2. All scheduler locks have been released.
  3. No spinlock-guarded per-CPU data is being accessed by this task.

At that point the preempt_count is irrelevant : the task will never run again, so bypassing the guard is both safe and necessary to prevent the dead task from spinning in a hlt() loop.