#include <rtl.h>
OS_RESULT os_tsk_prio_self (
U8 new_prio ); /* New priority of task (1-254) */
Description
The os_tsk_prio_self macro changes the priority of the
currently running task to new_prio.
The os_tsk_prio_self 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_self function always returns OS_R_OK.
#include <rtl.h>
OS_TID tsk1;
__task void task1 (void) {
..
os_tsk_prio_self(10); /* Increase its priority, for the critical section */
.. /* This is a critical section */
..
os_tsk_prio_self(2); /* Decrease its priority at end of critical section */
..
}
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.