RTEMS  5.0.0
corebarrierimpl.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 1989-2006.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef _RTEMS_SCORE_COREBARRIERIMPL_H
20 #define _RTEMS_SCORE_COREBARRIERIMPL_H
21 
23 #include <rtems/score/status.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
35 #define CORE_BARRIER_TQ_OPERATIONS &_Thread_queue_Operations_FIFO
36 
46  CORE_barrier_Control *the_barrier,
47  CORE_barrier_Attributes *the_barrier_attributes
48 );
49 
50 RTEMS_INLINE_ROUTINE void _CORE_barrier_Destroy(
51  CORE_barrier_Control *the_barrier
52 )
53 {
54  _Thread_queue_Destroy( &the_barrier->Wait_queue );
55 }
56 
57 RTEMS_INLINE_ROUTINE void _CORE_barrier_Acquire_critical(
58  CORE_barrier_Control *the_barrier,
59  Thread_queue_Context *queue_context
60 )
61 {
62  _Thread_queue_Acquire_critical( &the_barrier->Wait_queue, queue_context );
63 }
64 
65 RTEMS_INLINE_ROUTINE void _CORE_barrier_Release(
66  CORE_barrier_Control *the_barrier,
67  Thread_queue_Context *queue_context
68 )
69 {
70  _Thread_queue_Release( &the_barrier->Wait_queue, queue_context );
71 }
72 
87 Status_Control _CORE_barrier_Seize(
88  CORE_barrier_Control *the_barrier,
89  Thread_Control *executing,
90  bool wait,
91  Thread_queue_Context *queue_context
92 );
93 
94 uint32_t _CORE_barrier_Do_flush(
95  CORE_barrier_Control *the_barrier,
97  Thread_queue_Context *queue_context
98 );
99 
113  CORE_barrier_Control *the_barrier,
114  Thread_queue_Context *queue_context
115 )
116 {
117  return _CORE_barrier_Do_flush(
118  the_barrier,
120  queue_context
121  );
122 }
123 
124 RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(
125  CORE_barrier_Control *the_barrier,
126  Thread_queue_Context *queue_context
127 )
128 {
129  _CORE_barrier_Do_flush(
130  the_barrier,
132  queue_context
133  );
134 }
135 
145  CORE_barrier_Attributes *the_attribute
146 )
147 {
148  return
149  (the_attribute->discipline == CORE_BARRIER_AUTOMATIC_RELEASE);
150 }
151 
160  CORE_barrier_Control *the_barrier
161 )
162 {
163  return the_barrier->number_of_waiting_threads;
164 }
165 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif
173 /* end of include file */
Thread queue context for the thread queue methods.
Definition: threadq.h:193
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
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:1021
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:25
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:36
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Manually release the barrier.
Definition: corebarrierimpl.h:112
Definition: corebarrier.h:45
RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic(CORE_barrier_Attributes *the_attribute)
Definition: corebarrierimpl.h:144
Definition: thread.h:728
Status_Control _CORE_barrier_Seize(CORE_barrier_Control *the_barrier, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
Wait for the barrier.
Definition: corebarrierwait.c:25
Constants and Structures Associated with the Barrier Handler.
Thread_queue_Control Wait_queue
Definition: corebarrier.h:74
uint32_t number_of_waiting_threads
Definition: corebarrier.h:81
RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Get_number_of_waiting_threads(CORE_barrier_Control *the_barrier)
Definition: corebarrierimpl.h:159
Definition: corebarrier.h:70
Definition: corebarrier.h:56
CORE_barrier_Disciplines discipline
Definition: corebarrier.h:59
void _CORE_barrier_Initialize(CORE_barrier_Control *the_barrier, CORE_barrier_Attributes *the_barrier_attributes)
Initialize core barrier.
Definition: corebarrier.c:23