summaryrefslogtreecommitdiff
path: root/PACE/pace/win32/pthread.h
blob: 7fe07119ac88846ab45b9fd26ee10c8d1c1ac9a3 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/* $Id$

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    pace/posix/pthread.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */

#ifndef PACE_PTHREAD_H
#define PACE_PTHREAD_H

#include "pace/sys/types.h"
#include "pace/signal.h"
#include <pthread.h>

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

  PACE_INLINE int pace_pthread_atfork (void  (*prepare) (),
                                       void (*parent) (),
                                       void (*child) ());

  PACE_INLINE int pace_pthread_attr_destroy (pace_pthread_attr_t * attr);

  PACE_INLINE int pace_pthread_attr_getdetachstate (const pace_pthread_attr_t * attr,
                                                    int * detachstate);

  PACE_INLINE int pace_pthread_attr_getinheritsched (const pace_pthread_attr_t * attr,
                                                     int * inheritsched);

  PACE_INLINE int pace_pthread_attr_getschedparam (const pace_pthread_attr_t * attr,
                                                   struct sched_param * param);

  PACE_INLINE int pace_pthread_attr_getschedpolicy (const pace_pthread_attr_t * attr,
                                                    int * policy);

  PACE_INLINE int pace_pthread_attr_getscope (const pace_pthread_attr_t * attr,
                                              int * contentionscope);

  PACE_INLINE int pace_pthread_attr_getstackaddr (const pace_pthread_attr_t * attr,
                                                  void ** stackaddr);

  PACE_INLINE int pace_pthread_attr_getstacksize (const pace_pthread_attr_t * attr,
                                                  size_t * stacksize);

  PACE_INLINE int pace_pthread_attr_init (pace_pthread_attr_t * attr);

  PACE_INLINE int pace_pthread_attr_setdetachstate (pace_pthread_attr_t * attr,
                                                    int detachstate);

  PACE_INLINE int pace_pthread_attr_setinheritsched (pace_pthread_attr_t * attr,
                                                     int inheritsched);

  PACE_INLINE int pace_pthread_attr_setschedparam (pace_pthread_attr_t * attr,
                                                   const struct
                                                   sched_param * param);

  PACE_INLINE int pace_pthread_attr_setschedpolicy (pace_pthread_attr_t * attr,
                                                    int policy);

  PACE_INLINE int pace_pthread_attr_setscope (pace_pthread_attr_t * attr,
                                              int contentionscope);

  PACE_INLINE int pace_pthread_attr_setstackaddr (pace_pthread_attr_t * attr,
                                                  void * stackaddr);

  PACE_INLINE int pace_pthread_attr_setstacksize (pace_pthread_attr_t * attr,
                                                  size_t stacksize);

  PACE_INLINE int pace_pthread_cancel (pace_pthread_t thread);

  PACE_INLINE void pace_pthread_cleanup_push (void (*routine)(void*), void * arg);

  PACE_INLINE void pace_pthread_cleanup_pop (int execute);

  # define PACE_PTHREAD_COND_INITIALIZER PTHREAD_COND_INITIALIZER

  PACE_INLINE int pace_pthread_cond_broadcast (pace_pthread_cond_t * cond);

  PACE_INLINE int pace_pthread_cond_destroy (pace_pthread_cond_t * cond);

  PACE_INLINE int pace_pthread_cond_init (pace_pthread_cond_t * cond,
                                          const pace_pthread_condattr_t * attr);

  PACE_INLINE int pace_pthread_cond_signal (pace_pthread_cond_t * cond);

  PACE_INLINE int pace_pace_pthread_cond_timedwait (pthread_cond_t * cond,
                                               pace_pthread_mutex_t * mutex,
                                               const struct timespec * abstime);

  PACE_INLINE int pace_pthread_cond_wait (pace_pthread_cond_t * cond,
                                          pace_pthread_mutex_t * mutex);

  PACE_INLINE int pace_pthread_condattr_destroy (pace_pthread_condattr_t * attr);

  PACE_INLINE int pace_pthread_condattr_getpshared (const pace_pthread_condattr_t * attr,
                                                    int * pshared);

  PACE_INLINE int pace_pthead_condattr_init (pace_pthread_condattr_t * attr);

  PACE_INLINE int pace_pthread_condattr_setpshared (pace_pthread_condattr_t * attr,
                                                    int pshared);

  PACE_INLINE int pace_pthread_create (pace_pthread_t * thread,
                                       const pace_pthread_attr_t * attr,
                                       void * (*start_routine) (void*),
                                       void * arg);

  PACE_INLINE int pace_pthread_detach (pace_pthread_t thread);

  PACE_INLINE int pace_pthread_equal (pace_pthread_t t1, pthread_t t2);

  PACE_INLINE void pace_pthread_exit (void * value_ptr);

  PACE_INLINE int pace_pthread_getschedparam (pace_pthread_t thread,
                                              int * policy,
                                              struct sched_param * param);

  PACE_INLINE void * pace_pthread_getspecific (pace_pthread_key_t key);

  PACE_INLINE int pace_pthread_join (pace_pthread_t thread, void ** value_ptr);

  PACE_INLINE int pace_pthread_key_create (pace_pthread_key_t * key,
                                           void (*destructor)(void*));

  PACE_INLINE int pace_pthread_key_delete (pace_pthread_key_t key);

  PACE_INLINE int pace_pthread_kill (pace_pthread_t thread, int sig);

  # define PACE_PTHREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER

  PACE_INLINE int pace_pthread_mutex_destroy (pace_pthread_mutex_t * mutex);

  PACE_INLINE int pace_pthread_mutex_getprioceiling (pace_pthread_mutex_t * mutex,
                                                     int * prioceiling);

  PACE_INLINE int pace_pthread_mutex_init (pace_pthread_mutex_t * mutex,
                                           const pace_pthread_mutexattr_t * attr);

  PACE_INLINE int pace_pthread_mutex_lock (pace_pthread_mutex_t * mutex);

  PACE_INLINE int pace_pthread_mutex_setprioceiling (pace_pthread_mutex_t * mutex,
                                                     int prioceiling,
                                                     int * old_ceiling);

  PACE_INLINE int pace_pthread_mutex_trylock (pthread_mutex_t * mutex);

  PACE_INLINE int pace_pthread_mutex_unlock (pace_pthread_mutex_t * mutex);

  PACE_INLINE int pace_pthread_mutexattr_destroy (pace_pthread_mutexattr_t * sttr);

  PACE_INLINE int pace_pthread_mutexattr_getprioceiling (pace_pthread_mutexattr_t * attr,
                                                         int * prioceiling);

  PACE_INLINE int pace_pthread_mutexattr_getprotocol
                  (const pace_pthread_mutexattr_t * attr, int * protocol);

  PACE_INLINE int pace_pthread_mutexattr_setprioceiling (pace_pthread_mutexattr_t * attr,
                                                         int prioceiling);

  PACE_INLINE int pace_pthread_mutexattr_setprotocol (pace_pthread_mutexattr_t * attr,
                                                      int protocol);
  PACE_INLINE int
  pace_pthread_mutexattr_getpshared (const pace_pthread_mutexattr_t * attr,
                                     int * pshared);

  PACE_INLINE int pace_pthread_mutexattr_init (pace_pthread_mutexattr_t * attr);

  PACE_INLINE int pace_pthread_mutexattr_setpshared (pace_pthread_mutexattr_t * attr,
                                                     int pshared);

  PACE_INLINE int pace_pthread_once (pace_pthread_once_t * once_control,
                                     void (*void_routine) ());

  # define PACE_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT

  PACE_INLINE pace_pthread_t pace_pthread_self ();

  PACE_INLINE int pace_pthread_setcancelstate (int state, int * oldstate);

  PACE_INLINE int pace_pthread_setcanceltype (int type, int * oldtype);

  PACE_INLINE int pace_pthread_setschedparam (pace_pthread_t thread,
                                              int policy,
                                              const struct sched_param * param);

  PACE_INLINE int pace_pthread_setspecific (pace_pthread_key_t key, const void * value);

  PACE_INLINE int pace_pthread_sigmask (int how,
                                        const sigset_t * set,
                                        sigset_t * oset);

  PACE_INLINE void pace_pthread_testcancel ();

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

#if defined (PACE_HAS_INLINE)
# include "pace/posix/pthread.inl"
#endif /* PACE_HAS_INLINE */

#endif /* PACE_PTHREAD_H */