source: rtems/cpukit/include/rtems/rtems/barrier.h @ 395a49e1

5
Last change on this file since 395a49e1 was 395a49e1, checked in by Sebastian Huber <sebastian.huber@…>, on 11/08/18 at 09:12:21

rtems: Move internal structures to barrierdata.h

Update #3598.

  • Property mode set to 100644
File size: 4.0 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicBarrier
5 *
6 * @brief Classic Barrier Manager API
7 */
8
9/* COPYRIGHT (c) 1989-2008.
10 * On-Line Applications Research Corporation (OAR).
11 *
12 * The license and distribution terms for this file may be
13 * found in the file LICENSE in this distribution or at
14 * http://www.rtems.org/license/LICENSE.
15 */
16
17#ifndef _RTEMS_RTEMS_BARRIER_H
18#define _RTEMS_RTEMS_BARRIER_H
19
20#include <rtems/rtems/attr.h>
21#include <rtems/rtems/status.h>
22#include <rtems/rtems/types.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/**
29 * @defgroup ClassicBarrier Barriers
30 *
31 * @ingroup ClassicRTEMS
32 *
33 * This encapsulates functionality which implements the Classic API
34 * Barrier Manager.
35 */
36/**@{*/
37
38/**
39 * @brief RTEMS Create Barrier
40 *
41 * Barrier Manager -- Create a Barrier Instance
42 *
43 * This routine implements the rtems_barrier_create directive.  The
44 * barrier will have the name name. The starting count for
45 * the barrier is count. The attribute_set determines if
46 * the barrier is global or local and the thread queue
47 * discipline. It returns the id of the created barrier in ID.
48 *
49 * @param[in] name is the name of this barrier instance.
50 * @param[in] attribute_set specifies the attributes of this barrier instance.
51 * @param[in] maximum_waiters is the maximum number of threads which will
52 *            be allowed to concurrently wait at the barrier.
53 * @param[out] id will contain the id of this barrier.
54 *
55 * @retval a status code indicating success or the reason for failure.
56 */
57rtems_status_code rtems_barrier_create(
58  rtems_name           name,
59  rtems_attribute      attribute_set,
60  uint32_t             maximum_waiters,
61  rtems_id            *id
62);
63
64/**
65 * @brief RTEMS Barrier name to Id
66 *
67 * This routine implements the rtems_barrier_ident directive.
68 * This directive returns the barrier ID associated with name.
69 * If more than one barrier is named name, then the barrier
70 * to which the ID belongs is arbitrary. node indicates the
71 * extent of the search for the ID of the barrier named name.
72 * The search can be limited to a particular node or allowed to
73 * encompass all nodes.
74 *
75 * @param[in] name is the name of this barrier instance.
76 * @param[out] id will contain the id of this barrier.
77 *
78 * @retval a status code indicating success or the reason for failure.
79 */
80rtems_status_code rtems_barrier_ident(
81  rtems_name    name,
82  rtems_id     *id
83);
84
85/**
86 * @brief RTEMS Delete Barrier
87 *
88 * This routine implements the rtems_barrier_delete directive. The
89 * barrier indicated by @a id is deleted. The barrier is freed back to the
90 * inactive barrier chain.
91 *
92 *
93 * @param[in] id indicates the barrier to delete
94 *
95 * @retval a status code indicating success or the reason for failure.
96 */
97rtems_status_code rtems_barrier_delete(
98  rtems_id   id
99);
100
101/**
102 * @brief RTEMS Barrier Wait
103 *
104 * This routine implements the rtems_barrier_wait directive. It
105 * attempts to wait at the barrier associated with @a id. The calling task
106 * may block waiting for the barrier with an optional timeout of @a timeout
107 * clock ticks.
108 *
109 * @param[in] id indicates the barrier to wait at.
110 * @param[in] timeout is the maximum length of time in ticks the calling
111 *            thread is willing to block.
112 *
113 * @retval a status code indicating success or the reason for failure.
114 */
115rtems_status_code rtems_barrier_wait(
116  rtems_id       id,
117  rtems_interval timeout
118);
119
120/**
121 * @brief RTEMS Barrier Release
122 *
123 * Barrier Manager -- Release Tasks Waitng at a Barrier
124 *
125 * This routine implements the rtems_barrier_release directive. It
126 * unblocks all of the threads waiting on the barrier associated with
127 * @a id. The number of threads unblocked is returned in @a released.
128 *
129 *
130 * @param[in] id indicates the barrier to wait at.
131 * @param[out] released will contain the number of threads unblocked.
132 *
133 * @retval a status code indicating success or the reason for failure.
134 */
135rtems_status_code rtems_barrier_release(
136  rtems_id  id,
137  uint32_t *released
138);
139
140/**@}*/
141
142#ifdef __cplusplus
143}
144#endif
145
146#endif
147/*  end of include file */
Note: See TracBrowser for help on using the repository browser.