procedure Task_Set_Priority ( ID : in RTEMS.ID; New_Priority : in RTEMS.Task_Priority; Old_Priority : out RTEMS.Task_Priority; Result : out RTEMS.Status_Codes );
RTEMS.SUCCESSFUL
- task priority set successfully
RTEMS.INVALID_ID
- invalid task id
RTEMS.INVALID_ADDRESS
- invalid return argument pointer
RTEMS.INVALID_PRIORITY
- invalid task priority
This directive manipulates the priority of the task specified by
id. An id of RTEMS.SELF
is used to indicate
the calling task. When new_priority is not equal to
RTEMS.CURRENT_PRIORITY
, the specified
task's previous priority is returned in old_priority. When
new_priority is RTEMS.CURRENT_PRIORITY
,
the specified task's current
priority is returned in old_priority. Valid priorities range
from a high of 1 to a low of 255.
The calling task may be preempted if its preemption mode is enabled and it lowers its own priority or raises another task's priority.
Setting the priority of a global task which does not reside on the local node will generate a request to the remote node to change the priority of the specified task.
If the task specified by id is currently holding any binary semaphores which use the priority inheritance algorithm, then the task's priority cannot be lowered immediately. If the task's priority were lowered immediately, then priority inversion results. The requested lowering of the task's priority will occur when the task has released all priority inheritance binary semaphores. The task's priority can be increased regardless of the task's use of priority inheritance binary semaphores.
Copyright © 1988-2008 OAR Corporation