#include <rtl.h>
OS_RESULT os_tsk_prio (
OS_TID task_id, /* ID of the task */
U8 new_prio ); /* New priority of the task (1-254) */
Description
The os_tsk_prio function changes the execution priority of
the task identified by the argument task_id.
If the value of new_prio is higher than the priority of the
currently executing task, a task switch occurs to enable the task
identified by task_id to run. If the value of new_prio
is lower than the priority of the currently executing task, then the
currently executing task resumes its execution.
If the value of task_id is 0, the priority of the currently
running task is changed to new_prio.
The os_tsk_prio function is in the RL-RTX library. The
prototype is defined in rtl.h.
Note
The value of new_prio can be anything from 1 to
254.
The new priority stays in effect until you change it.
Priority 0 is reserved for the idle task. If priority 0 is
specified to the function, it is automatically replaced with the
value of 1 by the RTX kernel. Priority 255 is also reserved.
A higher value for new_prio indicates a higher
priority.
Return Value
The os_tsk_prio function returns one of these values:
Return Value
Description
OS_R_OK
The priority of a task has been successfully
changed.
OS_R_NOK
The task with task_id does
not exist or has not been started.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.