@@ -161,10 +161,10 @@ const char *svcRtxMutexGetName (osMutexId_t mutex_id) {
161
161
/// \note API identical to osMutexAcquire
162
162
osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id , uint32_t timeout ) {
163
163
os_mutex_t * mutex = (os_mutex_t * )mutex_id ;
164
- os_thread_t * runnig_thread ;
164
+ os_thread_t * running_thread ;
165
165
166
- runnig_thread = osRtxThreadGetRunning ();
167
- if (runnig_thread == NULL ) {
166
+ running_thread = osRtxThreadGetRunning ();
167
+ if (running_thread == NULL ) {
168
168
EvrRtxMutexError (mutex , osRtxErrorKernelNotRunning );
169
169
return osError ;
170
170
}
@@ -184,20 +184,20 @@ osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
184
184
// Check if Mutex is not locked
185
185
if (mutex -> lock == 0U ) {
186
186
// 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 ;
189
189
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 ;
192
192
}
193
- runnig_thread -> mutex_list = mutex ;
193
+ running_thread -> mutex_list = mutex ;
194
194
mutex -> lock = 1U ;
195
195
EvrRtxMutexAcquired (mutex , mutex -> lock );
196
196
return osOK ;
197
197
}
198
198
199
199
// 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 )) {
201
201
// Increment lock counter
202
202
if (mutex -> lock == osRtxMutexLockLimit ) {
203
203
EvrRtxMutexError (mutex , osRtxErrorMutexLockLimit );
@@ -213,14 +213,14 @@ osStatus_t svcRtxMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) {
213
213
// Check if Priority inheritance protocol is enabled
214
214
if (mutex -> attr & osMutexPrioInherit ) {
215
215
// 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 ;
218
218
osRtxThreadListSort (mutex -> owner_thread );
219
219
}
220
220
}
221
221
EvrRtxMutexAcquirePending (mutex , timeout );
222
222
// Suspend current Thread
223
- osRtxThreadListPut ((os_object_t * )mutex , runnig_thread );
223
+ osRtxThreadListPut ((os_object_t * )mutex , running_thread );
224
224
osRtxThreadWaitEnter (osRtxThreadWaitingMutex , timeout );
225
225
return osErrorTimeout ;
226
226
}
@@ -237,11 +237,11 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) {
237
237
os_mutex_t * mutex = (os_mutex_t * )mutex_id ;
238
238
os_mutex_t * mutex0 ;
239
239
os_thread_t * thread ;
240
- os_thread_t * runnig_thread ;
240
+ os_thread_t * running_thread ;
241
241
int8_t priority ;
242
242
243
- runnig_thread = osRtxThreadGetRunning ();
244
- if (runnig_thread == NULL ) {
243
+ running_thread = osRtxThreadGetRunning ();
244
+ if (running_thread == NULL ) {
245
245
EvrRtxMutexError (mutex , osRtxErrorKernelNotRunning );
246
246
return osError ;
247
247
}
@@ -259,7 +259,7 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) {
259
259
}
260
260
261
261
// Check if running Thread is not the owner
262
- if (mutex -> owner_thread != runnig_thread ) {
262
+ if (mutex -> owner_thread != running_thread ) {
263
263
EvrRtxMutexError (mutex , osRtxErrorMutexNotOwned );
264
264
return osErrorResource ;
265
265
}
@@ -286,13 +286,13 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) {
286
286
if (mutex -> owner_prev != NULL ) {
287
287
mutex -> owner_prev -> owner_next = mutex -> owner_next ;
288
288
} else {
289
- runnig_thread -> mutex_list = mutex -> owner_next ;
289
+ running_thread -> mutex_list = mutex -> owner_next ;
290
290
}
291
291
292
292
// Restore running Thread priority
293
293
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 ;
296
296
while (mutex0 ) {
297
297
// Mutexes owned by running Thread
298
298
if ((mutex0 -> thread_list != NULL ) && (mutex0 -> thread_list -> priority > priority )) {
@@ -301,7 +301,7 @@ osStatus_t svcRtxMutexRelease (osMutexId_t mutex_id) {
301
301
}
302
302
mutex0 = mutex0 -> owner_next ;
303
303
}
304
- runnig_thread -> priority = priority ;
304
+ running_thread -> priority = priority ;
305
305
}
306
306
307
307
// Check if Thread is waiting for a Mutex
0 commit comments