Skip to content

Commit 8e053c3

Browse files
Merge pull request #4646 from bulislaw/fix_rtx_mutex
RTX: Fixed RTXv5 mutex owner list handling.
2 parents 54b2816 + 8cc21ea commit 8e053c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rtos/rtx5/TARGET_CORTEX_M/rtx_mutex.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
187187
mutex->owner_thread = runnig_thread;
188188
mutex->owner_next = runnig_thread->mutex_list;
189189
mutex->owner_prev = NULL;
190+
if (runnig_thread->mutex_list != NULL) {
191+
runnig_thread->mutex_list->owner_prev = mutex;
192+
}
190193
runnig_thread->mutex_list = mutex;
191194
mutex->lock = 1U;
192195
EvrRtxMutexAcquired(mutex, mutex->lock);

0 commit comments

Comments
 (0)