diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-19 11:07:37 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 16:57:21 +0200 |
commit | 0444947e63715829d484b411f63244585ad6f449 (patch) | |
tree | 298f07f8b6a08ae743f94d7609cf79d36e8908b6 /cpukit/posix/src | |
parent | score: Create barrier implementation header (diff) | |
download | rtems-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')
-rw-r--r-- | cpukit/posix/src/pbarrierwait.c | 5 |
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: |