source: rtems/cpukit/posix/include/rtems/posix/mutex.h @ 39cefdd

4.104.114.84.95
Last change on this file since 39cefdd was 39cefdd, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/23/04 at 13:07:29

2004-03-23 Ralf Corsepius <ralf_corsepius@…>

  • posix/include/rtems/posix/cond.h, posix/include/rtems/posix/intr.h, posix/include/rtems/posix/key.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/semaphore.h, posix/include/rtems/posix/threadsup.h, posix/include/rtems/posix/timer.h, posix/src/cond.c, posix/src/intr.c, posix/src/key.c, posix/src/keycreate.c, posix/src/keydelete.c, posix/src/keygetspecific.c, posix/src/keyrundestructors.c, posix/src/keysetspecific.c, posix/src/killinfo.c, posix/src/mqueue.c, posix/src/mqueuerecvsupp.c, posix/src/mqueuesendsupp.c, posix/src/mqueuetranslatereturncode.c, posix/src/mutex.c, posix/src/posixintervaltotimespec.c, posix/src/posixtimespecsubtract.c, posix/src/psignal.c, posix/src/pthread.c, posix/src/ptimer1.c, posix/src/semaphore.c, posix/src/sysconf.c: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*  rtems/posix/mutex.h
2 *
3 *  This include file contains all the private support information for
4 *  POSIX mutex's.
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.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15 
16#ifndef __RTEMS_POSIX_MUTEX_h
17#define __RTEMS_POSIX_MUTEX_h
18 
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <rtems/score/coremutex.h>
24#include <pthread.h>
25
26/*
27 *  Data Structure used to manage a POSIX mutex
28 */
29 
30typedef struct {
31   Objects_Control     Object;
32   int                 process_shared;
33   CORE_mutex_Control  Mutex;
34}  POSIX_Mutex_Control;
35
36/*
37 *  The following defines the information control block used to manage
38 *  this class of objects.
39 */
40 
41POSIX_EXTERN Objects_Information  _POSIX_Mutex_Information;
42
43/*
44 *  The default mutex attributes structure.
45 */
46
47extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
48 
49/*
50 *  _POSIX_Mutex_Manager_initialization
51 *
52 *  DESCRIPTION:
53 *
54 *  This routine performs the initialization necessary for this manager.
55 */
56 
57void _POSIX_Mutex_Manager_initialization(
58  uint32_t   maximum_mutexes
59);
60 
61/*
62 *  _POSIX_Mutex_Allocate
63 *
64 *  DESCRIPTION:
65 *
66 *  This function allocates a mutexes control block from
67 *  the inactive chain of free mutexes control blocks.
68 */
69 
70RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
71 
72/*
73 *  _POSIX_Mutex_Free
74 *
75 *  DESCRIPTION:
76 *
77 *  This routine frees a mutexes control block to the
78 *  inactive chain of free mutexes control blocks.
79 */
80 
81RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
82  POSIX_Mutex_Control *the_mutex
83);
84 
85#if 0
86/*
87 *  _POSIX_Mutex_Get
88 *
89 *  DESCRIPTION:
90 *
91 *  This function maps mutexes IDs to mutexes control blocks.
92 *  If ID corresponds to a local mutexes, then it returns
93 *  the_mutex control pointer which maps to ID and location
94 *  is set to OBJECTS_LOCAL.  if the mutexes ID is global and
95 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
96 *  and the_mutex is undefined.  Otherwise, location is set
97 *  to OBJECTS_ERROR and the_mutex is undefined.
98 */
99 
100RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
101  Objects_Id        *id,
102  Objects_Locations *location
103);
104 
105/*
106 *  _POSIX_Mutex_Is_null
107 *
108 *  DESCRIPTION:
109 *
110 *  This function returns TRUE if the_mutex is NULL and FALSE otherwise.
111 */
112 
113RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
114  POSIX_Mutex_Control *the_mutex
115);
116#endif
117
118/*
119 *  _POSIX_Mutex_Lock_support
120 *
121 *  DESCRIPTION:
122 * 
123 *  A support routine which implements guts of the blocking, non-blocking, and
124 *  timed wait version of mutex lock.
125 */
126
127int _POSIX_Mutex_Lock_support(
128  pthread_mutex_t           *mutex,
129  boolean                    blocking,
130  Watchdog_Interval          timeout
131);
132
133/*
134 *  _POSIX_Mutex_From_core_mutex_status
135 *
136 *  DESCRIPTION:
137 *
138 *  A support routine which converts core mutex status codes into the
139 *  appropriate POSIX status values.
140 */
141
142int _POSIX_Mutex_From_core_mutex_status(
143  CORE_mutex_Status  status
144);
145
146
147#include <rtems/posix/mutex.inl>
148#if defined(RTEMS_MULTIPROCESSING)
149#include <rtems/posix/mutexmp.h>
150#endif
151
152#ifdef __cplusplus
153}
154#endif
155 
156#endif
157/*  end of include file */
158
Note: See TracBrowser for help on using the repository browser.