summaryrefslogtreecommitdiff
path: root/PACE/pace/semaphore.h
blob: fd4bc1fcebe07b9dbb9435e41365a814f714d283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* $Id$

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    pace/semaphore.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */

#ifndef PACE_SEMAPHORE_H
#define PACE_SEMAPHORE_H

#include "pace/config/defines.h"

#if (PACE_HAS_POSIX)
# include "pace/posix/semaphore.h"
#elif (PACE_VXWORKS)
# include "pace/vxworks/semaphore.h"
#elif (PACE_WIN32)
# include "pace/win32/semaphore.h"
#endif

#if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
#endif /* PACE_HAS_CPLUSPLUS */

  /**
     PACE's implementation of the POSIX function sem_close.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.4.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_sem_close (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function sem_destroy.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.2.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_sem_destroy (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function sem_getvalue.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.8.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_sem_getvalue (pace_sem_t * sem, int * sval);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function sem_init.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.1.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_sem_init (pace_sem_t * sem, int pshared, unsigned int value);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function sem_open.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.3.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
# if defined (PACE_HAS_CPLUSPLUS)
#  define pace_sem_open ::sem_open
# else
#  define pace_sem_open sem_open
# endif /* PACE_HAS_CPLUSPLUS */
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function sem_post.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.7.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_sem_post (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function sem_trywait.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.6.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_sem_trywait (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function sem_unlink.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.5.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_sem_unlink (const char * name);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

  /**
     PACE's implementation of the POSIX function sem_wait.
     See POSIX standard (Internation Standard ISO/IEC 9945-1:1996;
     IEEE Std 1003.1, 1996 Edition), Section 11.2.6.
   */
#if (PACE_HAS_POSIX_NONUOF_FUNCS)
  PACE_INLINE int pace_sem_wait (pace_sem_t * sem);
#endif /* PACE_HAS_POSIX_NONUOF_FUNCS */

#if defined (PACE_HAS_INLINE)
#  if (PACE_HAS_POSIX)
#    include "pace/posix/semaphore.inl"
#  elif (PACE_VXWORKS)
#    include "pace/vxworks/semaphore.inl"
#  elif (PACE_WIN32)
#    include "pace/win32/semaphore.inl"
#  endif
#endif /* PACE_HAS_INLINE */

#if defined (PACE_HAS_CPLUSPLUS)
}
#endif /* PACE_HAS_CPLUSPLUS */

#endif /* PACE_SEMAPHORE_H */