-
chg_pri
ichg_pri
-
ER chg_pri (ID tskid, PRI tskpri);
ER ichg_pri (ID tskid, PRI tskpri);
|
|
|
|
ID tskid;
|
Value: ID number of the task.
|
|
PRI tskpri;
|
New base priority of the task.
Value: New base priority of the task.
|
This service call changes the base priority of the task specified by parameter
tskid to a value specified by parameter
tskpri.
The changed base priority is effective until the task terminates or this service call is issued. When next the task is activated, the base priority is the initial priority which is specified at the task creation.
This service call also changes the current priority of the target task to a value specified by parameter
tskpri. However, the current priority is not changed when the target task has locked mutexes.
If the target task has locked mutexes or is waiting for mutex to be locked and if
tskpri is higher than the ceiling priority of either of the mutexes, this service call returns "E_ILUSE".
When the current priority is changed, the following state variations are generated.
1 ) When the target task is in the RUNNING or READY state.
This service call re-queues the task at the end of the ready queue corresponding to the priority specified by parameter
tskpri.
2 ) When the target task is queued to a wait queue of the object with TA_TPRI or TA_CEILING attribute.
This service call re-queues the task to the wait queue corresponding to the priority specified by parameter
tskpri. When two or more tasks of same current priority as
tskpri, this service call re-queues the target task at the end among their tasks.
Example When three tasks (task A: priority level 10, task B: priority level 11, task C: priority level 12) are queued to the semaphore wait queue in the order of priority, and the priority level of task B is changed from 11 to 9, the wait order will be changed as follows.
|
|
|
|
|
|
|
|
|
|
|
- When ichg_pri was issued from a non-task, TSK_SELF was specified for tskid.
|
|
|
- This service call was issued in the CPU locked state.
- The ichg_pri was issued from task.
- The chg_pri was issued from non-task.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
|
|
|
Memory access violation. (only for chg_pri)
- Stack pointer points out of user stack for invoking task.
|
|
|
Illegal use of service call.
- tskpri < The ceiling priority of the mutex locked by the target task.
- tskpri < The ceiling priority of the mutex by which the target task waits for lock.
|
|
|
- Specified task is in the DORMANT state.
|
|
|
- The task specified by tskid does not exist.
|