RTEMS  5.0.0
Files | Data Structures | Macros | Enumerations | Functions
Barrier Handler

Files

file  corebarrier.c
 Initialize CORE Barrier.
 
file  corebarrierrelease.c
 Manually releases the Barrier.
 
file  corebarrierwait.c
 Wait For The Barrier.
 

Data Structures

struct  CORE_barrier_Attributes
 
struct  CORE_barrier_Control
 

Macros

#define CORE_BARRIER_TQ_OPERATIONS   &_Thread_queue_Operations_FIFO
 

Enumerations

enum  CORE_barrier_Disciplines { CORE_BARRIER_AUTOMATIC_RELEASE, CORE_BARRIER_MANUAL_RELEASE }
 

Functions

void _CORE_barrier_Initialize (CORE_barrier_Control *the_barrier, CORE_barrier_Attributes *the_barrier_attributes)
 Initialize core barrier. More...
 
RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy (CORE_barrier_Control *the_barrier)
 
RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical (CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
 
RTEMS_INLINE_ROUTINE void _CORE_barrier_Release (CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
 
Status_Control _CORE_barrier_Seize (CORE_barrier_Control *the_barrier, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
 Wait for the barrier. More...
 
uint32_t _CORE_barrier_Do_flush (CORE_barrier_Control *the_barrier, Thread_queue_Flush_filter filter, Thread_queue_Context *queue_context)
 
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender (CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
 Manually release the barrier. More...
 
RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush (CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
 
RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic (CORE_barrier_Attributes *the_attribute)
 
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Get_number_of_waiting_threads (CORE_barrier_Control *the_barrier)
 

Detailed Description

This handler encapsulates functionality which provides the foundation Barrier services used in all of the APIs supported by RTEMS.

Enumeration Type Documentation

◆ CORE_barrier_Disciplines

Flavors of barriers.

Enumerator
CORE_BARRIER_AUTOMATIC_RELEASE 

This specifies that the barrier will automatically release when the user specified number of threads have arrived at the barrier.

CORE_BARRIER_MANUAL_RELEASE 

This specifies that the user will have to manually release the barrier in order to release the waiting threads.

Function Documentation

◆ _CORE_barrier_Get_number_of_waiting_threads()

RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Get_number_of_waiting_threads ( CORE_barrier_Control the_barrier)

This routine returns the number of threads currently waiting at the barrier.

Parameters
[in]the_barrieris the barrier to obtain the number of blocked threads for
Returns
the current count of this barrier

◆ _CORE_barrier_Initialize()

void _CORE_barrier_Initialize ( CORE_barrier_Control the_barrier,
CORE_barrier_Attributes the_barrier_attributes 
)

Initialize core barrier.

This routine initializes the barrier based on the parameters passed.

Parameters
[in]the_barrieris the barrier to initialize
[in]the_barrier_attributesdefine the behavior of this instance

◆ _CORE_barrier_Is_automatic()

RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic ( CORE_barrier_Attributes the_attribute)

This function returns true if the automatic release attribute is enabled in the attribute_set and false otherwise.

Parameters
[in]the_attributeis the attribute set to test
Returns
true if the priority attribute is enabled

◆ _CORE_barrier_Seize()

Status_Control _CORE_barrier_Seize ( CORE_barrier_Control the_barrier,
Thread_Control executing,
bool  wait,
Thread_queue_Context queue_context 
)

Wait for the barrier.

This routine wait for the barrier to be released. If the barrier is set to automatic and this is the appropriate thread, then it returns immediately. Otherwise, the calling thread is blocked until the barrier is released.

Parameters
[in]the_barrieris the barrier to wait for
[in,out]executingThe currently executing thread.
[in]waitis true if the calling thread is willing to wait
Returns
The method status.

◆ _CORE_barrier_Surrender()

RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender ( CORE_barrier_Control the_barrier,
Thread_queue_Context queue_context 
)

Manually release the barrier.

This routine manually releases the barrier. All of the threads waiting for the barrier will be readied.

Parameters
[in]the_barrieris the barrier to surrender
[in]mp_calloutis the routine to invoke if the thread unblocked is remote
Return values
thenumber of unblocked threads