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/score | |
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/score')
-rw-r--r-- | cpukit/score/include/rtems/score/corebarrierimpl.h | 2 | ||||
-rw-r--r-- | cpukit/score/src/corebarrierwait.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/score/include/rtems/score/corebarrierimpl.h b/cpukit/score/include/rtems/score/corebarrierimpl.h index cc225537af..0353efb67d 100644 --- a/cpukit/score/include/rtems/score/corebarrierimpl.h +++ b/cpukit/score/include/rtems/score/corebarrierimpl.h @@ -92,6 +92,7 @@ void _CORE_barrier_Initialize( * is released. * * @param[in] the_barrier is the barrier to wait for + * @param[in,out] executing The currently executing thread. * @param[in] id is the id of the object being waited upon * @param[in] wait is true if the calling thread is willing to wait * @param[in] timeout is the number of ticks the calling thread is willing @@ -103,6 +104,7 @@ void _CORE_barrier_Initialize( */ void _CORE_barrier_Wait( CORE_barrier_Control *the_barrier, + Thread_Control *executing, Objects_Id id, bool wait, Watchdog_Interval timeout, diff --git a/cpukit/score/src/corebarrierwait.c b/cpukit/score/src/corebarrierwait.c index a5b685a779..465402ab82 100644 --- a/cpukit/score/src/corebarrierwait.c +++ b/cpukit/score/src/corebarrierwait.c @@ -27,16 +27,15 @@ void _CORE_barrier_Wait( CORE_barrier_Control *the_barrier, + Thread_Control *executing, Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { - Thread_Control *executing; ISR_Level level; - executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); the_barrier->number_of_waiting_threads++; |