summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/corebarrierwait.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/corebarrierwait.c')
-rw-r--r--cpukit/score/src/corebarrierwait.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/cpukit/score/src/corebarrierwait.c b/cpukit/score/src/corebarrierwait.c
index 6267ae67c0..39687d31da 100644
--- a/cpukit/score/src/corebarrierwait.c
+++ b/cpukit/score/src/corebarrierwait.c
@@ -32,30 +32,29 @@ void _CORE_barrier_Wait(
CORE_barrier_API_mp_support_callout api_barrier_mp_support
)
{
- ISR_Level level;
+ ISR_lock_Context lock_context;
executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL;
- _ISR_Disable( level );
+ _Thread_queue_Acquire( &the_barrier->Wait_queue, &lock_context );
the_barrier->number_of_waiting_threads++;
if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) {
if ( the_barrier->number_of_waiting_threads ==
the_barrier->Attributes.maximum_count) {
executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED;
- _ISR_Enable( level );
+ _Thread_queue_Release( &the_barrier->Wait_queue, &lock_context );
_CORE_barrier_Release( the_barrier, id, api_barrier_mp_support );
return;
}
}
- _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue );
- executing->Wait.queue = &the_barrier->Wait_queue;
- executing->Wait.id = id;
- _ISR_Enable( level );
+ executing->Wait.id = id;
- _Thread_queue_Enqueue(
+ _Thread_queue_Enqueue_critical(
&the_barrier->Wait_queue,
executing,
STATES_WAITING_FOR_BARRIER,
- timeout
+ timeout,
+ CORE_BARRIER_TIMEOUT,
+ &lock_context
);
}