RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
corebarrierimpl.h
Go to the documentation of this file.
1
12/*
13 * COPYRIGHT (c) 1989-2006.
14 * On-Line Applications Research Corporation (OAR).
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef _RTEMS_SCORE_COREBARRIERIMPL_H
22#define _RTEMS_SCORE_COREBARRIERIMPL_H
23
25#include <rtems/score/status.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
46
56 CORE_barrier_Control *the_barrier,
57 CORE_barrier_Attributes *the_barrier_attributes
58);
59
68 CORE_barrier_Control *the_barrier
69)
70{
71 _Thread_queue_Destroy( &the_barrier->Wait_queue );
72}
73
81 CORE_barrier_Control *the_barrier,
82 Thread_queue_Context *queue_context
83)
84{
85 _Thread_queue_Acquire_critical( &the_barrier->Wait_queue, queue_context );
86}
87
95 CORE_barrier_Control *the_barrier,
96 Thread_queue_Context *queue_context
97)
98{
99 _Thread_queue_Release( &the_barrier->Wait_queue, queue_context );
100}
101
117Status_Control _CORE_barrier_Seize(
118 CORE_barrier_Control *the_barrier,
119 Thread_Control *executing,
120 bool wait,
121 Thread_queue_Context *queue_context
122);
123
132 CORE_barrier_Control *the_barrier,
134 Thread_queue_Context *queue_context
135);
136
149 CORE_barrier_Control *the_barrier,
150 Thread_queue_Context *queue_context
151)
152{
154 the_barrier,
156 queue_context
157 );
158}
159
167 CORE_barrier_Control *the_barrier,
168 Thread_queue_Context *queue_context
169)
170{
172 the_barrier,
174 queue_context
175 );
176}
177
190 CORE_barrier_Attributes *the_attribute
191)
192{
193 return
194 (the_attribute->discipline == CORE_BARRIER_AUTOMATIC_RELEASE);
195}
196
208 CORE_barrier_Control *the_barrier
209)
210{
211 return the_barrier->number_of_waiting_threads;
212}
213
216#ifdef __cplusplus
217}
218#endif
219
220#endif
221/* end of include file */
Constants and Structures Associated with the Barrier Handler.
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Manually releases the barrier.
Definition: corebarrierimpl.h:148
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Get_number_of_waiting_threads(CORE_barrier_Control *the_barrier)
Returns the number of currently waiting threads.
Definition: corebarrierimpl.h:207
RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic(CORE_barrier_Attributes *the_attribute)
Checks if the barrier is automatic.
Definition: corebarrierimpl.h:189
Status_Control _CORE_barrier_Seize(CORE_barrier_Control *the_barrier, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
Waits for the barrier.
Definition: corebarrierwait.c:55
const Thread_queue_Operations _CORE_barrier_Thread_queue_operations
These thread queue operations are used for core barriers.
Definition: corebarrierwait.c:47
RTEMS_INLINE_ROUTINE void _CORE_barrier_Release(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Releases core barrier.
Definition: corebarrierimpl.h:94
RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Acquires critical core barrier.
Definition: corebarrierimpl.h:80
void _CORE_barrier_Initialize(CORE_barrier_Control *the_barrier, CORE_barrier_Attributes *the_barrier_attributes)
Initializes the core barrier.
Definition: corebarrier.c:23
RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy(CORE_barrier_Control *the_barrier)
Destroys the core barrier.
Definition: corebarrierimpl.h:67
uint32_t _CORE_barrier_Do_flush(CORE_barrier_Control *the_barrier, Thread_queue_Flush_filter filter, Thread_queue_Context *queue_context)
Flushes the barrier.
Definition: corebarrierrelease.c:24
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().
Definition: corebarrierimpl.h:166
@ CORE_BARRIER_AUTOMATIC_RELEASE
Definition: corebarrier.h:50
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
RTEMS_INLINE_ROUTINE void _Thread_queue_Release(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Releases the thread queue control and enables interrupts.
Definition: threadqimpl.h:787
Thread_Control *(* Thread_queue_Flush_filter)(Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
Thread queue flush filter function.
Definition: threadqimpl.h:1223
RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire_critical(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Acquires the thread queue control in a critical section.
Definition: threadqimpl.h:681
RTEMS_INLINE_ROUTINE void _Thread_queue_Destroy(Thread_queue_Control *the_thread_queue)
Destroys the thread queue.
Definition: threadqimpl.h:1378
Thread_Control * _Thread_queue_Flush_status_object_was_deleted(Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
Status object was deleted thread queue flush filter function.
Definition: threadqflush.c:37
Thread_Control * _Thread_queue_Flush_default_filter(Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
Default thread queue flush filter function.
Definition: threadqflush.c:26
Definition: corebarrier.h:61
CORE_barrier_Disciplines discipline
Definition: corebarrier.h:64
Definition: corebarrier.h:75
uint32_t number_of_waiting_threads
Definition: corebarrier.h:86
Thread_queue_Control Wait_queue
Definition: corebarrier.h:79
Thread queue context for the thread queue methods.
Definition: threadq.h:198
Thread queue operations.
Definition: threadq.h:518
Definition: thread.h:732
Constants and Structures Associated with the Manipulation of Objects.