From 4d1ad1d3d5c90f533934105a11da7a64f67566a7 Mon Sep 17 00:00:00 2001 From: Kevin Gilbert Date: Fri, 30 Jun 2017 17:24:43 -0500 Subject: [PATCH] Fix typo runnig_thread -> running_thread --- rtos/rtx5/TARGET_CORTEX_M/rtx_mutex.c | 40 +++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/rtos/rtx5/TARGET_CORTEX_M/rtx_mutex.c b/rtos/rtx5/TARGET_CORTEX_M/rtx_mutex.c index 2151c0251d..4a274f8616 100644 --- a/rtos/rtx5/TARGET_CORTEX_M/rtx_mutex.c +++ b/rtos/rtx5/TARGET_CORTEX_M/rtx_mutex.c @@ -161,10 +161,10 @@ const char *svcRtxMutexGetName (osMutexId_t mutex_id) { /// \note API identical to osMutexAcquire osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) { os_mutex_t *mutex = (os_mutex_t *)mutex_id; - os_thread_t *runnig_thread; + os_thread_t *running_thread; - runnig_thread = osRtxThreadGetRunning(); - if (runnig_thread == NULL) { + running_thread = osRtxThreadGetRunning(); + if (running_thread == NULL) { EvrRtxMutexError(mutex, osRtxErrorKernelNotRunning); return osError; } @@ -184,20 +184,20 @@ osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) { // Check if Mutex is not locked if (mutex->lock == 0U) { // Acquire Mutex - mutex->owner_thread = runnig_thread; - mutex->owner_next = runnig_thread->mutex_list; + mutex->owner_thread = running_thread; + mutex->owner_next = running_thread->mutex_list; mutex->owner_prev = NULL; - if (runnig_thread->mutex_list != NULL) { - runnig_thread->mutex_list->owner_prev = mutex; + if (running_thread->mutex_list != NULL) { + running_thread->mutex_list->owner_prev = mutex; } - runnig_thread->mutex_list = mutex; + running_thread->mutex_list = mutex; mutex->lock = 1U; EvrRtxMutexAcquired(mutex, mutex->lock); return osOK; } // Check if Mutex is recursive and running Thread is the owner - if ((mutex->attr & osMutexRecursive) && (mutex->owner_thread == runnig_thread)) { + if ((mutex->attr & osMutexRecursive) && (mutex->owner_thread == running_thread)) { // Increment lock counter if (mutex->lock == osRtxMutexLockLimit) { EvrRtxMutexError(mutex, osRtxErrorMutexLockLimit); @@ -213,14 +213,14 @@ osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) { // Check if Priority inheritance protocol is enabled if (mutex->attr & osMutexPrioInherit) { // Raise priority of owner Thread if lower than priority of running Thread - if (mutex->owner_thread->priority < runnig_thread->priority) { - mutex->owner_thread->priority = runnig_thread->priority; + if (mutex->owner_thread->priority < running_thread->priority) { + mutex->owner_thread->priority = running_thread->priority; osRtxThreadListSort(mutex->owner_thread); } } EvrRtxMutexAcquirePending(mutex, timeout); // Suspend current Thread - osRtxThreadListPut((os_object_t*)mutex, runnig_thread); + osRtxThreadListPut((os_object_t*)mutex, running_thread); osRtxThreadWaitEnter(osRtxThreadWaitingMutex, timeout); return osErrorTimeout; } @@ -237,11 +237,11 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) { os_mutex_t *mutex = (os_mutex_t *)mutex_id; os_mutex_t *mutex0; os_thread_t *thread; - os_thread_t *runnig_thread; + os_thread_t *running_thread; int8_t priority; - runnig_thread = osRtxThreadGetRunning(); - if (runnig_thread == NULL) { + running_thread = osRtxThreadGetRunning(); + if (running_thread == NULL) { EvrRtxMutexError(mutex, osRtxErrorKernelNotRunning); return osError; } @@ -259,7 +259,7 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) { } // Check if running Thread is not the owner - if (mutex->owner_thread != runnig_thread) { + if (mutex->owner_thread != running_thread) { EvrRtxMutexError(mutex, osRtxErrorMutexNotOwned); return osErrorResource; } @@ -286,13 +286,13 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) { if (mutex->owner_prev != NULL) { mutex->owner_prev->owner_next = mutex->owner_next; } else { - runnig_thread->mutex_list = mutex->owner_next; + running_thread->mutex_list = mutex->owner_next; } // Restore running Thread priority if (mutex->attr & osMutexPrioInherit) { - priority = runnig_thread->priority_base; - mutex0 = runnig_thread->mutex_list; + priority = running_thread->priority_base; + mutex0 = running_thread->mutex_list; while (mutex0) { // Mutexes owned by running Thread if ((mutex0->thread_list != NULL) && (mutex0->thread_list->priority > priority)) { @@ -301,7 +301,7 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) { } mutex0 = mutex0->owner_next; } - runnig_thread->priority = priority; + running_thread->priority = priority; } // Check if Thread is waiting for a Mutex