summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pbarrierwait.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-19 11:07:37 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-22 16:57:21 +0200
commit0444947e63715829d484b411f63244585ad6f449 (patch)
tree298f07f8b6a08ae743f94d7609cf79d36e8908b6 /cpukit/posix/src/pbarrierwait.c
parentscore: Create barrier implementation header (diff)
downloadrtems-0444947e63715829d484b411f63244585ad6f449.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/pbarrierwait.c')
-rw-r--r--cpukit/posix/src/pbarrierwait.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/posix/src/pbarrierwait.c b/cpukit/posix/src/pbarrierwait.c
index 036932ed96..1d7b9811c5 100644
--- a/cpukit/posix/src/pbarrierwait.c
+++ b/cpukit/posix/src/pbarrierwait.c
@@ -40,6 +40,7 @@ int pthread_barrier_wait(
{
POSIX_Barrier_Control *the_barrier = NULL;
Objects_Locations location;
+ Thread_Control *executing;
if ( !barrier )
return EINVAL;
@@ -48,8 +49,10 @@ int pthread_barrier_wait(
switch ( location ) {
case OBJECTS_LOCAL:
+ executing = _Thread_Executing;
_CORE_barrier_Wait(
&the_barrier->Barrier,
+ executing,
the_barrier->Object.id,
true,
0,
@@ -57,7 +60,7 @@ int pthread_barrier_wait(
);
_Objects_Put( &the_barrier->Object );
return _POSIX_Barrier_Translate_core_barrier_return_code(
- _Thread_Executing->Wait.return_code );
+ executing->Wait.return_code );
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: