kernel/mutex: prevent priority inheritance from lowering owner's prio
If the system's priority inheritance priority ceiling is not the same as the highest priority in the system, it was possible for a thread owning the mutex to get its priority lowered instead of left unchanged. Change-Id: Ic06a1c4a66322c2949b2ba2f53efa03200fb1fc1 Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
This commit is contained in:
parent
e669559010
commit
4bfa0055b7
1 changed files with 3 additions and 1 deletions
|
|
@ -173,7 +173,9 @@ int k_mutex_lock(struct k_mutex *mutex, int32_t timeout)
|
|||
|
||||
K_DEBUG("adjusting prio up on mutex %p\n", mutex);
|
||||
|
||||
adjust_owner_prio(mutex, new_prio);
|
||||
if (_is_prio_higher(new_prio, mutex->owner->base.prio)) {
|
||||
adjust_owner_prio(mutex, new_prio);
|
||||
}
|
||||
|
||||
_pend_current_thread(&mutex->wait_q, timeout);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue