summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/mutexlocksupp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-17 15:53:17 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-18 09:58:58 +0200
commit95e09afa92c5d0522a0d04019ef6680796688896 (patch)
tree2c04a60ed5669b4baba5a783e1919b4b4a37d858 /cpukit/posix/src/mutexlocksupp.c
parentscore: Convert to inline function (diff)
downloadrtems-95e09afa92c5d0522a0d04019ef6680796688896.tar.bz2
score: Avoid direct usage of _Thread_Executing
Pass the executing thread as a function parameter. Obtain the executing thread inside a thread dispatch critical section to avoid problems on SMP.
Diffstat (limited to 'cpukit/posix/src/mutexlocksupp.c')
-rw-r--r--cpukit/posix/src/mutexlocksupp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/posix/src/mutexlocksupp.c b/cpukit/posix/src/mutexlocksupp.c
index 8b6274bd5b..3bcf92447f 100644
--- a/cpukit/posix/src/mutexlocksupp.c
+++ b/cpukit/posix/src/mutexlocksupp.c
@@ -47,13 +47,16 @@ int _POSIX_Mutex_Lock_support(
register POSIX_Mutex_Control *the_mutex;
Objects_Locations location;
ISR_Level level;
+ Thread_Control *executing;
the_mutex = _POSIX_Mutex_Get_interrupt_disable( mutex, &location, &level );
switch ( location ) {
case OBJECTS_LOCAL:
+ executing = _Thread_Executing;
_CORE_mutex_Seize(
&the_mutex->Mutex,
+ executing,
the_mutex->Object.id,
blocking,
timeout,
@@ -61,7 +64,7 @@ int _POSIX_Mutex_Lock_support(
);
_Objects_Put_for_get_isr_disable( &the_mutex->Object );
return _POSIX_Mutex_Translate_core_mutex_return_code(
- (CORE_mutex_Status) _Thread_Executing->Wait.return_code
+ (CORE_mutex_Status) executing->Wait.return_code
);
#if defined(RTEMS_MULTIPROCESSING)