RTEMS: Barrier Handler

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Files | Data Structures | Enumerations | Functions | Variables
Barrier Handler
Internal » SuperCore

Functionality for Foundation Barrier Services. More...

## Files
file | corebarrier.h
| Constants and Structures Associated with the Barrier Handler.
file | corebarrierimpl.h
| Inlined Routines Associated with the SuperCore Barrier.
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

## 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)
| Initializes the core barrier.
RTEMS_INLINE_ROUTINE void | _CORE_barrier_Destroy (CORE_barrier_Control *the_barrier)
| Destroys the core barrier.
RTEMS_INLINE_ROUTINE void | _CORE_barrier_Acquire_critical (CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
| Acquires critical core barrier.
RTEMS_INLINE_ROUTINE void | _CORE_barrier_Release (CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
| Releases core barrier.
Status_Control | _CORE_barrier_Seize (CORE_barrier_Control *the_barrier, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
| Waits for the barrier.
uint32_t | _CORE_barrier_Do_flush (CORE_barrier_Control *the_barrier, Thread_queue_Flush_filter filter, Thread_queue_Context *queue_context)
| Flushes the barrier.
RTEMS_INLINE_ROUTINE uint32_t | _CORE_barrier_Surrender (CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
| Manually releases the barrier.
RTEMS_INLINE_ROUTINE void | _CORE_barrier_Flush (CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
| Flushes the barrier using _CORE_barrier_Do_flush().
RTEMS_INLINE_ROUTINE bool | _CORE_barrier_Is_automatic (CORE_barrier_Attributes *the_attribute)
| Checks if the barrier is automatic.
RTEMS_INLINE_ROUTINE uint32_t | _CORE_barrier_Get_number_of_waiting_threads (CORE_barrier_Control *the_barrier)
| Returns the number of currently waiting threads.

## Variables
const Thread_queue_Operations | _CORE_barrier_Thread_queue_operations
| These thread queue operations are used for core barriers.

## Detailed Description

Functionality for Foundation Barrier Services.

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

enum 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_Acquire_critical()

RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical | ( | CORE_barrier_Control * | the_barrier,
|  | Thread_queue_Context * | queue_context
| ) |  |

Acquires critical core barrier.

Parameters

  [in,out] | the_barrier | The barrier to acquire.
  | queue_context | The thread queue context.

## ◆ _CORE_barrier_Destroy()

RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy | ( | CORE_barrier_Control * | the_barrier | ) |

Destroys the core barrier.

This routine destroys the barrier.

Parameters

  [out] | the_barrier | The barrier to destroy.

## ◆ _CORE_barrier_Do_flush()

uint32_t _CORE_barrier_Do_flush | ( | CORE_barrier_Control * | the_barrier,
|  | Thread_queue_Flush_filter | filter,
|  | Thread_queue_Context * | queue_context
| ) |  |

Flushes the barrier.

Parameters

  [in,out] | the_barrier | The barrier to flush.
  [out] | filter | The filter for flushing.
  [out] | queue_context | The thread queue context.

## ◆ _CORE_barrier_Flush()

RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush | ( | CORE_barrier_Control * | the_barrier,
|  | Thread_queue_Context * | queue_context
| ) |  |

Flushes the barrier using _CORE_barrier_Do_flush().

Parameters

  [in,out] | the_barrier | The barrier to flush.
  | queue_context | The thread queue context.

## ◆ _CORE_barrier_Get_number_of_waiting_threads()

RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Get_number_of_waiting_threads | ( | CORE_barrier_Control * | the_barrier | ) |

Returns the number of currently waiting threads.

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

Parameters

  [in] | the_barrier | The barrier to obtain the number of blocked threads of.

Returns
  the current count of waiting threads of this barrier.

## ◆ _CORE_barrier_Initialize()

void _CORE_barrier_Initialize | ( | CORE_barrier_Control * | the_barrier,
|  | CORE_barrier_Attributes * | the_barrier_attributes
| ) |  |

Initializes the core barrier.

This routine initializes the barrier based on the parameters passed.

Parameters

  [out] | the_barrier | The barrier to initialize.
  [out] | the_barrier_attributes | The attributes which define the behavior of this instance.

## ◆ _CORE_barrier_Is_automatic()

RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic | ( | CORE_barrier_Attributes * | the_attribute | ) |

Checks if the barrier is automatic.

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

Parameters

  the_attribute | The attribute set to test.

Return values

  true | The automatic release attribute is enabled.
  false | The automatic release attribute is not enabled.

## ◆ _CORE_barrier_Release()

RTEMS_INLINE_ROUTINE void _CORE_barrier_Release | ( | CORE_barrier_Control * | the_barrier,
|  | Thread_queue_Context * | queue_context
| ) |  |

Releases core barrier.

Parameters

  [in,out] | the_barrier | The barrier to release.
  | queue_context | The thread queue context.

## ◆ _CORE_barrier_Seize()

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

Waits for the barrier.

This routine waits 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,out] | the_barrier | The barrier to wait for.
  [in,out] | executing | The currently executing thread.
  | wait | This parameter is true if the calling thread is willing to wait.
  | queue_context | The thread queue context.

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 releases the barrier.

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

Parameters

  [in,out] | the_barrier | The barrier to surrender.
  [out] | queue_context | The thread queue context.

Returns
  The number of unblocked threads.

## Variable Documentation

## ◆ _CORE_barrier_Thread_queue_operations

const Thread_queue_Operations _CORE_barrier_Thread_queue_operations
| extern

These thread queue operations are used for core barriers.

They are a specialization of _Thread_queue_Operations_FIFO. The only difference is that the extract operation decrements CORE_barrier_Control::number_of_waiting_threads.