OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [include/] [rtems/] [posix/] [cond.h] - Blame information for rev 593

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  rtems/posix/cond.h
2
 *
3
 *  This include file contains all the private support information for
4
 *  POSIX condition variables.
5
 *
6
 *  COPYRIGHT (c) 1989-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: cond.h,v 1.2 2001-09-27 11:59:14 chris Exp $
14
 */
15
 
16
#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_h
17
#define __RTEMS_POSIX_CONDITION_VARIABLES_h
18
 
19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22
 
23
#include <rtems/score/object.h>
24
#include <rtems/score/threadq.h>
25
 
26
/*
27
 *  Constant to indicate condition variable does not currently have
28
 *  a mutex assigned to it.
29
 */
30
 
31
#define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
32
 
33
/*
34
 *  Data Structure used to manage a POSIX condition variable
35
 */
36
 
37
typedef struct {
38
   Objects_Control       Object;
39
   int                   process_shared;
40
   pthread_mutex_t       Mutex;
41
   Thread_queue_Control  Wait_queue;
42
}  POSIX_Condition_variables_Control;
43
 
44
/*
45
 *  The following defines the information control block used to manage
46
 *  this class of objects.
47
 */
48
 
49
POSIX_EXTERN Objects_Information  _POSIX_Condition_variables_Information;
50
 
51
/*
52
 *  The default condition variable attributes structure.
53
 */
54
 
55
extern const pthread_condattr_t _POSIX_Condition_variables_Default_attributes;
56
 
57
/*
58
 *  _POSIX_Condition_variables_Manager_initialization
59
 *
60
 *  DESCRIPTION:
61
 *
62
 *  This routine performs the initialization necessary for this manager.
63
 */
64
 
65
void _POSIX_Condition_variables_Manager_initialization(
66
  unsigned32 maximum_condition_variables
67
);
68
 
69
/*
70
 *  _POSIX_Condition_variables_Allocate
71
 *
72
 *  DESCRIPTION:
73
 *
74
 *  This function allocates a condition variable control block from
75
 *  the inactive chain of free condition variable control blocks.
76
 */
77
 
78
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *
79
  _POSIX_Condition_variables_Allocate( void );
80
 
81
/*
82
 *  _POSIX_Condition_variables_Free
83
 *
84
 *  DESCRIPTION:
85
 *
86
 *  This routine frees a condition variable control block to the
87
 *  inactive chain of free condition variable control blocks.
88
 */
89
 
90
RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free (
91
  POSIX_Condition_variables_Control *the_condition_variable
92
);
93
 
94
/*
95
 *  _POSIX_Condition_variables_Get
96
 *
97
 *  DESCRIPTION:
98
 *
99
 *  This function maps condition variable IDs to condition variable control
100
 *  blocks.  If ID corresponds to a local condition variable, then it returns
101
 *  the_condition variable control pointer which maps to ID and location
102
 *  is set to OBJECTS_LOCAL.  if the condition variable ID is global and
103
 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
104
 *  and the_condition variable is undefined.  Otherwise, location is set
105
 *  to OBJECTS_ERROR and the_condition variable is undefined.
106
 */
107
 
108
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
109
  Objects_Id        *id,
110
  Objects_Locations *location
111
);
112
 
113
/*
114
 *  _POSIX_Condition_variables_Is_null
115
 *
116
 *  DESCRIPTION:
117
 *
118
 *  This function returns TRUE if the_condition variable is NULL
119
 *  and FALSE otherwise.
120
 */
121
 
122
RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null (
123
  POSIX_Condition_variables_Control *the_condition_variable
124
);
125
 
126
/*
127
 *  _POSIX_Condition_variables_Signal_support
128
 *
129
 *  DESCRIPTION:
130
 *
131
 *  A support routine which implements guts of the broadcast and single task
132
 *  wake up version of the "signal" operation.
133
 */
134
 
135
int _POSIX_Condition_variables_Signal_support(
136
  pthread_cond_t            *cond,
137
  boolean                    is_broadcast
138
);
139
 
140
/*
141
 *  _POSIX_Condition_variables_Wait_support
142
 *
143
 *  DESCRIPTION:
144
 *
145
 *  A support routine which implements guts of the blocking, non-blocking, and
146
 *  timed wait version of condition variable wait routines.
147
 */
148
 
149
int _POSIX_Condition_variables_Wait_support(
150
  pthread_cond_t            *cond,
151
  pthread_mutex_t           *mutex,
152
  Watchdog_Interval          timeout,
153
  boolean                    already_timedout
154
);
155
 
156
#include <rtems/posix/cond.inl>
157
#if defined(RTEMS_MULTIPROCESSING)
158
#include <rtems/posix/condmp.h>
159
#endif
160
 
161
#ifdef __cplusplus
162
}
163
#endif
164
 
165
#endif
166
/*  end of include file */
167
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.