Hi,
We understand form the user manual, the OS has the following behaviour when we call
OS_Use()
Quote" Case C: The resource is being used by another task.
The execution of this task is suspended until the resource semaphore is released.
In the meantime if the task blocked by the resource semaphore has a higher priority
than the task blocking the semaphore, the blocking task is assigned the priority
of the task requesting the resource semaphore. This is called priority
inheritance. Priority inheritance can only temporarily increase the priority of a
task, never reduce it."
When we executed OS_Use() in Task A and inherited the priority of the higher priority task (Task B) which also calls OS_Use(), Task A we call
OS_GetPriority()and we noticed that priority of A was not changed to higher priority but reflecting the base priority.
best regards
Chu-Lih
TaskA()
{
OS_Use(&pRSema);
OS_Delay(30);
OS_GetPriority(NULL);
while (1)
{}
}
TaskA()
{
OS_Delay(20);
OS_Use(&pRSema);
while (1)
{}
}
We understand form the user manual, the OS has the following behaviour when we call
OS_Use()
Quote" Case C: The resource is being used by another task.
The execution of this task is suspended until the resource semaphore is released.
In the meantime if the task blocked by the resource semaphore has a higher priority
than the task blocking the semaphore, the blocking task is assigned the priority
of the task requesting the resource semaphore. This is called priority
inheritance. Priority inheritance can only temporarily increase the priority of a
task, never reduce it."
When we executed OS_Use() in Task A and inherited the priority of the higher priority task (Task B) which also calls OS_Use(), Task A we call
OS_GetPriority()and we noticed that priority of A was not changed to higher priority but reflecting the base priority.
best regards
Chu-Lih
TaskA()
{
OS_Use(&pRSema);
OS_Delay(30);
OS_GetPriority(NULL);
while (1)
{}
}
TaskA()
{
OS_Delay(20);
OS_Use(&pRSema);
while (1)
{}
}