summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/barrierwait.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/rtems/src/barrierwait.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/rtems/src/barrierwait.c')
-rw-r--r--cpukit/rtems/src/barrierwait.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/rtems/src/barrierwait.c b/cpukit/rtems/src/barrierwait.c
index 515f9352c7..a233908bf1 100644
--- a/cpukit/rtems/src/barrierwait.c
+++ b/cpukit/rtems/src/barrierwait.c
@@ -32,13 +32,16 @@ rtems_status_code rtems_barrier_wait(
{
Barrier_Control *the_barrier;
Objects_Locations location;
+ Thread_Control *executing;
the_barrier = _Barrier_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
+ executing = _Thread_Executing;
_CORE_barrier_Wait(
&the_barrier->Barrier,
+ executing,
id,
true,
timeout,
@@ -46,7 +49,7 @@ rtems_status_code rtems_barrier_wait(
);
_Objects_Put( &the_barrier->Object );
return _Barrier_Translate_core_barrier_return_code(
- _Thread_Executing->Wait.return_code );
+ executing->Wait.return_code );
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: