source: vendor/emx/current/include/sys/rmutex.h

Last change on this file was 18, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.7 KB
Line 
1/* sys/rmutex.h (emx+gcc) */
2
3/* _rmutex semaphores are registered _fmutex semaphores. They are a
4 bit bigger than _fmutex metaphores but they are inherited by child
5 processes created with fork(). Shared _rmutex semaphores behave
6 like _fmutex semaphores, ie, they are not registered and therefore
7 not inherited by child processes created with fork(). (As malloc()
8 uses _rmutex semaphores, we have to support shared semaphores
9 anyway.) */
10
11/* This header requires <sys/builtin.h> and <sys/fmutex.h>. */
12
13#ifndef _SYS_RMUTEX_H
14#define _SYS_RMUTEX_H
15
16#if defined (__cplusplus)
17extern "C" {
18#endif
19
20/* See also <emx/io.h> and /emx/test/internal.c. */
21typedef struct __rmutex
22{
23 struct __rmutex *next;
24 struct __rmutex *prev;
25 _fmutex fm;
26 unsigned char flags;
27 unsigned short count;
28} _rmutex;
29
30
31static __inline__ unsigned _rmutex_request (_rmutex *sem, unsigned flags)
32{
33 return _fmutex_request (&sem->fm, flags);
34}
35
36
37static __inline__ unsigned _rmutex_release (_rmutex *sem)
38{
39 return _fmutex_release (&sem->fm);
40}
41
42
43static __inline__ int _rmutex_available (_rmutex *sem)
44{
45 return _fmutex_available (&sem->fm);
46}
47
48
49unsigned _rmutex_close (_rmutex *);
50unsigned _rmutex_create (_rmutex *, unsigned);
51unsigned _rmutex_open (_rmutex *);
52void _rmutex_dummy (_rmutex *);
53
54
55static __inline__ void _rmutex_checked_release (_rmutex *sem)
56{
57 _fmutex_checked_release (&sem->fm);
58}
59
60
61static __inline__ void _rmutex_checked_request (_rmutex *sem, unsigned flags)
62{
63 _fmutex_checked_request (&sem->fm, flags);
64}
65
66
67void _rmutex_checked_close (_rmutex *);
68void _rmutex_checked_create (_rmutex *, unsigned);
69void _rmutex_checked_open (_rmutex *);
70
71#if defined (__cplusplus)
72}
73#endif
74
75#endif /* not _SYS_RMUTEX_H */
Note: See TracBrowser for help on using the repository browser.