Skip to main content

current_task

Function current_task 

Source
pub fn current_task() -> Option<TaskId>
Expand description

The identity of the task currently being polled. None if called outside of a task’s poll (e.g. from an ISR or before the executor starts).

Used by Semaphore::acquire(), Channel::send()/recv(), and Sleep to register themselves as waiters without requiring the caller to pass (priority, index) explicitly.