mirror of https://github.com/ARMmbed/mbed-os.git
RTX: Fixed RTXv5 mutex owner list handling.
The prev-pointer of the running threads mutex list was not set when multiple mutexes are acquired at a time. This leads to a corrupted list if the mutexes are not freed in reversed order. Original commit for CMSIS_5: commit 729f6ab08540342b7de7612fac103539d5b2f168 Author: Jonatan Antoni <jonatan.antoni@arm.com> Date: Wed Apr 19 15:38:43 2017 +0200pull/4689/head
parent
e161088dc5
commit
1b7a15501c
|
@ -187,6 +187,9 @@ osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
|
|||
mutex->owner_thread = runnig_thread;
|
||||
mutex->owner_next = runnig_thread->mutex_list;
|
||||
mutex->owner_prev = NULL;
|
||||
if (runnig_thread->mutex_list != NULL) {
|
||||
runnig_thread->mutex_list->owner_prev = mutex;
|
||||
}
|
||||
runnig_thread->mutex_list = mutex;
|
||||
mutex->lock = 1U;
|
||||
EvrRtxMutexAcquired(mutex, mutex->lock);
|
||||
|
|
Loading…
Reference in New Issue