source: rtems/cpukit/posix/include/rtems/posix/cond.h @ 309e2f6

4.104.115
Last change on this file since 309e2f6 was 309e2f6, checked in by Joel Sherrill <joel.sherrill@…>, on 12/17/08 at 21:23:37

2008-12-17 Joel Sherrill <joel.sherrill@…>

  • posix/include/rtems/posix/barrier.h, posix/include/rtems/posix/cond.h, posix/include/rtems/posix/key.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/psignal.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/ptimer.h, posix/include/rtems/posix/rwlock.h, posix/include/rtems/posix/semaphore.h, posix/include/rtems/posix/spinlock.h, posix/include/rtems/posix/timer.h, posix/src/cond.c, posix/src/key.c, posix/src/mqueue.c, posix/src/mutex.c, posix/src/pbarrier.c, posix/src/prwlock.c, posix/src/psignal.c, posix/src/pspin.c, posix/src/pthread.c, posix/src/pthreadinitthreads.c, posix/src/ptimer.c, posix/src/semaphore.c, sapi/src/posixapi.c: Convert POSIX manager initialization routines to directly pull parameters from configuration table.
  • Property mode set to 100644
File size: 4.3 KB
Line 
1/**
2 * @file rtems/posix/cond.h
3 */
4
5/*
6 *  This include file contains all the private support information for
7 *  POSIX condition variables.
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.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#ifndef _RTEMS_POSIX_COND_H
20#define _RTEMS_POSIX_COND_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#include <rtems/score/object.h>
27#include <rtems/score/threadq.h>
28
29/*
30 *  Constant to indicate condition variable does not currently have
31 *  a mutex assigned to it.
32 */
33
34#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
35
36/*
37 *  Data Structure used to manage a POSIX condition variable
38 */
39
40typedef struct {
41   Objects_Control       Object;
42   int                   process_shared;
43   pthread_mutex_t       Mutex;
44   Thread_queue_Control  Wait_queue;
45}  POSIX_Condition_variables_Control;
46
47/*
48 *  The following defines the information control block used to manage
49 *  this class of objects.
50 */
51
52POSIX_EXTERN Objects_Information  _POSIX_Condition_variables_Information;
53
54/*
55 *  The default condition variable attributes structure.
56 */
57
58extern const pthread_condattr_t _POSIX_Condition_variables_Default_attributes;
59
60/*
61 *  _POSIX_Condition_variables_Manager_initialization
62 *
63 *  DESCRIPTION:
64 *
65 *  This routine performs the initialization necessary for this manager.
66 */
67
68void _POSIX_Condition_variables_Manager_initialization(void);
69
70/*
71 *  _POSIX_Condition_variables_Allocate
72 *
73 *  DESCRIPTION:
74 *
75 *  This function allocates a condition variable control block from
76 *  the inactive chain of free condition variable control blocks.
77 */
78
79RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
80  _POSIX_Condition_variables_Allocate( void );
81
82/*
83 *  _POSIX_Condition_variables_Free
84 *
85 *  DESCRIPTION:
86 *
87 *  This routine frees a condition variable control block to the
88 *  inactive chain of free condition variable control blocks.
89 */
90
91RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
92  POSIX_Condition_variables_Control *the_condition_variable
93);
94
95/*
96 *  _POSIX_Condition_variables_Get
97 *
98 *  DESCRIPTION:
99 *
100 *  This function maps condition variable IDs to condition variable control
101 *  blocks.  If ID corresponds to a local condition variable, then it returns
102 *  the_condition variable control pointer which maps to ID and location
103 *  is set to OBJECTS_LOCAL.  if the condition variable ID is global and
104 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
105 *  and the_condition variable is undefined.  Otherwise, location is set
106 *  to OBJECTS_ERROR and the_condition variable is undefined.
107 */
108
109#if 0
110RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
111  Objects_Id        *id,
112  Objects_Locations *location
113);
114#endif
115
116/*
117 *  _POSIX_Condition_variables_Is_null
118 *
119 *  DESCRIPTION:
120 *
121 *  This function returns TRUE if the_condition variable is NULL
122 *  and FALSE otherwise.
123 */
124
125RTEMS_INLINE_ROUTINE bool _POSIX_Condition_variables_Is_null (
126  POSIX_Condition_variables_Control *the_condition_variable
127);
128
129/*
130 *  _POSIX_Condition_variables_Signal_support
131 *
132 *  DESCRIPTION:
133 *
134 *  A support routine which implements guts of the broadcast and single task
135 *  wake up version of the "signal" operation.
136 */
137
138int _POSIX_Condition_variables_Signal_support(
139  pthread_cond_t            *cond,
140  bool                       is_broadcast
141);
142
143/*
144 *  _POSIX_Condition_variables_Wait_support
145 *
146 *  DESCRIPTION:
147 *
148 *  A support routine which implements guts of the blocking, non-blocking, and
149 *  timed wait version of condition variable wait routines.
150 */
151
152int _POSIX_Condition_variables_Wait_support(
153  pthread_cond_t            *cond,
154  pthread_mutex_t           *mutex,
155  Watchdog_Interval          timeout,
156  bool                       already_timedout
157);
158
159/*
160 *  _POSIX_Condition_variables_Get
161 *
162 *  DESCRIPTION:
163 *
164 *  A support routine which translates the condition variable id into
165 *  a local pointer.  As a side-effect, it may create the condition
166 *  variable.
167 */
168
169POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
170  pthread_cond_t    *cond,
171  Objects_Locations *location
172);
173
174#include <rtems/posix/cond.inl>
175
176#ifdef __cplusplus
177}
178#endif
179
180#endif
181/*  end of include file */
Note: See TracBrowser for help on using the repository browser.