Skip to main content

Module task

Module task 

Source
Expand description

Multi-threading management.

Structs§

AxRawMutex
A non-recursive, urgency-ordered PI mutex implementing lock_api::RawMutex.
AxTaskHandle
A handle to a task.
AxWaitQueueHandle
A handle to a wait queue.

Functions§

ax_current_task_id
Returns the current task’s ID.
ax_exit
Exits the current task with the given exit code.
ax_set_current_affinity
Sets the cpu affinity of the current task.
ax_set_current_priority
Sets the priority of the current task.
ax_sleep_until
Current task is going to sleep, it will be woken up at the given monotonic deadline.
ax_spawn
Spawns a new task with the given entry point and other arguments.
ax_wait_for_exit
Waits for the given task to exit, and returns its exit code (the argument of ax_exit).
ax_wait_queue_wait
Blocks the current task and put it into the wait queue, until other tasks notify the wait queue, or the given duration has elapsed (if specified).
ax_wait_queue_wait_until
Blocks the current task and put it into the wait queue, until the given condition becomes true, or the given duration has elapsed (if specified).
ax_wait_queue_wait_until_deadline
Blocks until the condition becomes true or an absolute monotonic deadline elapses. Returns true only when the deadline wins.
ax_wait_queue_wake
Wakes up one or more tasks in the wait queue.
ax_yield_now
Current task gives up the CPU time voluntarily, and switches to another ready task.

Type Aliases§

AxCpuMask
A mask to specify the CPU affinity.