source: rtems/c/src/exec/posix/headers/cond.h @ 5e9b32b

4.104.114.84.95
Last change on this file since 5e9b32b was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/95 at 19:27:15

posix support initially added

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*  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, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16 
17#ifndef __RTEMS_POSIX_CONDITION_VARIABLES_h
18#define __RTEMS_POSIX_CONDITION_VARIABLES_h
19 
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <rtems/score/object.h>
25#include <rtems/score/threadq.h>
26
27/*
28 *  Data Structure used to manage a POSIX condition variable
29 */
30 
31typedef struct {
32   Objects_Control       Object;
33   int                   process_shared;
34   pthread_mutex_t       Mutex;
35   Thread_queue_Control  Wait_queue;
36}  POSIX_Condition_variables_Control;
37
38/*
39 *  The following defines the information control block used to manage
40 *  this class of objects.
41 */
42 
43EXTERN Objects_Information  _POSIX_Condition_variables_Information;
44 
45/*
46 *  _POSIX_Condition_variables_Manager_initialization
47 *
48 *  DESCRIPTION:
49 *
50 *  This routine performs the initialization necessary for this manager.
51 */
52 
53void _POSIX_Condition_variables_Manager_initialization(
54  unsigned32 maximum_condition_variables
55);
56 
57/*
58 *  _POSIX_Condition_variables_Allocate
59 *
60 *  DESCRIPTION:
61 *
62 *  This function allocates a condition variable control block from
63 *  the inactive chain of free condition variable control blocks.
64 */
65 
66STATIC INLINE POSIX_Condition_variables_Control *
67  _POSIX_Condition_variables_Allocate( void );
68 
69/*
70 *  _POSIX_Condition_variables_Free
71 *
72 *  DESCRIPTION:
73 *
74 *  This routine frees a condition variable control block to the
75 *  inactive chain of free condition variable control blocks.
76 */
77 
78STATIC INLINE void _POSIX_Condition_variables_Free (
79  POSIX_Condition_variables_Control *the_condition_variable
80);
81 
82/*
83 *  _POSIX_Condition_variables_Get
84 *
85 *  DESCRIPTION:
86 *
87 *  This function maps condition variable IDs to condition variable control
88 *  blocks.  If ID corresponds to a local condition variable, then it returns
89 *  the_condition variable control pointer which maps to ID and location
90 *  is set to OBJECTS_LOCAL.  if the condition variable ID is global and
91 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
92 *  and the_condition variable is undefined.  Otherwise, location is set
93 *  to OBJECTS_ERROR and the_condition variable is undefined.
94 */
95 
96STATIC INLINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
97  Objects_Id        *id,
98  Objects_Locations *location
99);
100 
101/*
102 *  _POSIX_Condition_variables_Is_null
103 *
104 *  DESCRIPTION:
105 *
106 *  This function returns TRUE if the_condition variable is NULL
107 *  and FALSE otherwise.
108 */
109 
110STATIC INLINE boolean _POSIX_Condition_variables_Is_null (
111  POSIX_Condition_variables_Control *the_condition_variable
112);
113
114#include <rtems/posix/cond.inl>
115#include <rtems/posix/condmp.h>
116
117#ifdef __cplusplus
118}
119#endif
120 
121#endif
122/*  end of include file */
123
Note: See TracBrowser for help on using the repository browser.