Skip to content

Commit 036778b

Browse files
Merge pull request #4685 from kegilbert/running-thread-typo-fix
Rename runnig_thread to running_thread in rtx_mutex
2 parents 99b37b2 + 4d1ad1d commit 036778b

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

rtos/rtx5/TARGET_CORTEX_M/rtx_mutex.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ const char *svcRtxMutexGetName (osMutexId_t mutex_id) {
161161
/// \note API identical to osMutexAcquire
162162
osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
163163
os_mutex_t *mutex = (os_mutex_t *)mutex_id;
164-
os_thread_t *runnig_thread;
164+
os_thread_t *running_thread;
165165

166-
runnig_thread = osRtxThreadGetRunning();
167-
if (runnig_thread == NULL) {
166+
running_thread = osRtxThreadGetRunning();
167+
if (running_thread == NULL) {
168168
EvrRtxMutexError(mutex, osRtxErrorKernelNotRunning);
169169
return osError;
170170
}
@@ -184,20 +184,20 @@ osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
184184
// Check if Mutex is not locked
185185
if (mutex->lock == 0U) {
186186
// Acquire Mutex
187-
mutex->owner_thread = runnig_thread;
188-
mutex->owner_next = runnig_thread->mutex_list;
187+
mutex->owner_thread = running_thread;
188+
mutex->owner_next = running_thread->mutex_list;
189189
mutex->owner_prev = NULL;
190-
if (runnig_thread->mutex_list != NULL) {
191-
runnig_thread->mutex_list->owner_prev = mutex;
190+
if (running_thread->mutex_list != NULL) {
191+
running_thread->mutex_list->owner_prev = mutex;
192192
}
193-
runnig_thread->mutex_list = mutex;
193+
running_thread->mutex_list = mutex;
194194
mutex->lock = 1U;
195195
EvrRtxMutexAcquired(mutex, mutex->lock);
196196
return osOK;
197197
}
198198

199199
// Check if Mutex is recursive and running Thread is the owner
200-
if ((mutex->attr & osMutexRecursive) && (mutex->owner_thread == runnig_thread)) {
200+
if ((mutex->attr & osMutexRecursive) && (mutex->owner_thread == running_thread)) {
201201
// Increment lock counter
202202
if (mutex->lock == osRtxMutexLockLimit) {
203203
EvrRtxMutexError(mutex, osRtxErrorMutexLockLimit);
@@ -213,14 +213,14 @@ osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
213213
// Check if Priority inheritance protocol is enabled
214214
if (mutex->attr & osMutexPrioInherit) {
215215
// Raise priority of owner Thread if lower than priority of running Thread
216-
if (mutex->owner_thread->priority < runnig_thread->priority) {
217-
mutex->owner_thread->priority = runnig_thread->priority;
216+
if (mutex->owner_thread->priority < running_thread->priority) {
217+
mutex->owner_thread->priority = running_thread->priority;
218218
osRtxThreadListSort(mutex->owner_thread);
219219
}
220220
}
221221
EvrRtxMutexAcquirePending(mutex, timeout);
222222
// Suspend current Thread
223-
osRtxThreadListPut((os_object_t*)mutex, runnig_thread);
223+
osRtxThreadListPut((os_object_t*)mutex, running_thread);
224224
osRtxThreadWaitEnter(osRtxThreadWaitingMutex, timeout);
225225
return osErrorTimeout;
226226
}
@@ -237,11 +237,11 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) {
237237
os_mutex_t *mutex = (os_mutex_t *)mutex_id;
238238
os_mutex_t *mutex0;
239239
os_thread_t *thread;
240-
os_thread_t *runnig_thread;
240+
os_thread_t *running_thread;
241241
int8_t priority;
242242

243-
runnig_thread = osRtxThreadGetRunning();
244-
if (runnig_thread == NULL) {
243+
running_thread = osRtxThreadGetRunning();
244+
if (running_thread == NULL) {
245245
EvrRtxMutexError(mutex, osRtxErrorKernelNotRunning);
246246
return osError;
247247
}
@@ -259,7 +259,7 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) {
259259
}
260260

261261
// Check if running Thread is not the owner
262-
if (mutex->owner_thread != runnig_thread) {
262+
if (mutex->owner_thread != running_thread) {
263263
EvrRtxMutexError(mutex, osRtxErrorMutexNotOwned);
264264
return osErrorResource;
265265
}
@@ -286,13 +286,13 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) {
286286
if (mutex->owner_prev != NULL) {
287287
mutex->owner_prev->owner_next = mutex->owner_next;
288288
} else {
289-
runnig_thread->mutex_list = mutex->owner_next;
289+
running_thread->mutex_list = mutex->owner_next;
290290
}
291291

292292
// Restore running Thread priority
293293
if (mutex->attr & osMutexPrioInherit) {
294-
priority = runnig_thread->priority_base;
295-
mutex0 = runnig_thread->mutex_list;
294+
priority = running_thread->priority_base;
295+
mutex0 = running_thread->mutex_list;
296296
while (mutex0) {
297297
// Mutexes owned by running Thread
298298
if ((mutex0->thread_list != NULL) && (mutex0->thread_list->priority > priority)) {
@@ -301,7 +301,7 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) {
301301
}
302302
mutex0 = mutex0->owner_next;
303303
}
304-
runnig_thread->priority = priority;
304+
running_thread->priority = priority;
305305
}
306306

307307
// Check if Thread is waiting for a Mutex

0 commit comments

Comments
 (0)