source: rtems/cpukit/posix/include/rtems/posix/mutex.h @ 976162a6

4.104.114.9
Last change on this file since 976162a6 was 976162a6, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 3, 2007 at 10:23:13 PM

2007-12-03 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/malloc.c, libmisc/monitor/mon-command.c, posix/preinstall.am, posix/include/rtems/posix/cond.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/src/conddestroy.c, posix/src/mutexdestroy.c, posix/src/mutexinit.c, posix/src/mutexsetprioceiling.c, posix/src/mutexunlock.c, sapi/include/confdefs.h, sapi/include/rtems/config.h, sapi/include/rtems/init.h, sapi/include/rtems/sptables.h, sapi/src/exinit.c, score/include/rtems/system.h, score/include/rtems/score/mpci.h, score/src/mpci.c, score/src/thread.c, score/src/threadcreateidle.c, score/src/threadstackallocate.c, score/src/threadstackfree.c, score/src/wkspace.c: Moved most of the remaining CPU Table fields to the Configuration Table. This included pretasking_hook, predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace, extra_mpci_receive_server_stack, stack_allocate_hook, and stack_free_hook. As a side-effect of this effort some multiprocessing code was made conditional and some style clean up occurred.
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/**
2 * @file rtems/posix/mutex.h
3 */
4
5/*
6 *  This include file contains all the private support information for
7 *  POSIX mutex's.
8 *
9 *  COPYRIGHT (c) 1989-2007.
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_MUTEX_H
20#define _RTEMS_POSIX_MUTEX_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#include <rtems/score/coremutex.h>
27#include <pthread.h>
28
29/*
30 *  Data Structure used to manage a POSIX mutex
31 */
32
33typedef struct {
34   Objects_Control     Object;
35   int                 process_shared;
36   CORE_mutex_Control  Mutex;
37}  POSIX_Mutex_Control;
38
39/*
40 *  The following defines the information control block used to manage
41 *  this class of objects.
42 */
43
44POSIX_EXTERN Objects_Information  _POSIX_Mutex_Information;
45
46/*
47 *  The default mutex attributes structure.
48 */
49
50extern const pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
51
52/*
53 *  _POSIX_Mutex_Manager_initialization
54 *
55 *  DESCRIPTION:
56 *
57 *  This routine performs the initialization necessary for this manager.
58 */
59
60void _POSIX_Mutex_Manager_initialization(
61  uint32_t   maximum_mutexes
62);
63
64/*
65 *  _POSIX_Mutex_Allocate
66 *
67 *  DESCRIPTION:
68 *
69 *  This function allocates a mutexes control block from
70 *  the inactive chain of free mutexes control blocks.
71 */
72
73RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void );
74
75/*
76 *  _POSIX_Mutex_Free
77 *
78 *  DESCRIPTION:
79 *
80 *  This routine frees a mutexes control block to the
81 *  inactive chain of free mutexes control blocks.
82 */
83
84RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free (
85  POSIX_Mutex_Control *the_mutex
86);
87
88#if 0
89/*
90 *  _POSIX_Mutex_Get
91 *
92 *  DESCRIPTION:
93 *
94 *  This function maps mutexes IDs to mutexes control blocks.
95 *  If ID corresponds to a local mutexes, then it returns
96 *  the_mutex control pointer which maps to ID and location
97 *  is set to OBJECTS_LOCAL.  if the mutexes ID is global and
98 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
99 *  and the_mutex is undefined.  Otherwise, location is set
100 *  to OBJECTS_ERROR and the_mutex is undefined.
101 */
102
103RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Get (
104  Objects_Id        *id,
105  Objects_Locations *location
106);
107
108/*
109 *  _POSIX_Mutex_Is_null
110 *
111 *  DESCRIPTION:
112 *
113 *  This function returns TRUE if the_mutex is NULL and FALSE otherwise.
114 */
115
116RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null (
117  POSIX_Mutex_Control *the_mutex
118);
119#endif
120
121/*
122 *  _POSIX_Mutex_Lock_support
123 *
124 *  DESCRIPTION:
125 *
126 *  A support routine which implements guts of the blocking, non-blocking, and
127 *  timed wait version of mutex lock.
128 */
129
130int _POSIX_Mutex_Lock_support(
131  pthread_mutex_t           *mutex,
132  boolean                    blocking,
133  Watchdog_Interval          timeout
134);
135
136/*
137 *  _POSIX_Mutex_Translate_core_mutex_return_code
138 *
139 *  DESCRIPTION:
140 *
141 *  A support routine which converts core mutex status codes into the
142 *  appropriate POSIX status values.
143 */
144
145int _POSIX_Mutex_Translate_core_mutex_return_code(
146  CORE_mutex_Status  the_mutex_status
147);
148
149
150#include <rtems/posix/mutex.inl>
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif
157/*  end of include file */
Note: See TracBrowser for help on using the repository browser.