26
26
#include <sys/types.h>
27
27
#include <sys/time.h>
28
28
#include <errno.h>
29
- #include < exec/types.h>
30
- #include < exec/semaphores.h>
31
29
#include <sched.h>
32
30
#include <features.h>
33
31
34
- #ifdef __cplusplus
35
- #ifdef __USE_AMIGAOS_NAMESPACE__
36
- namespace AmigaOS {
37
- #endif
38
- extern " C" {
39
- #endif
32
+ __BEGIN_DECLS
40
33
41
34
//
42
35
// POSIX options
@@ -150,7 +143,7 @@ struct pthread_mutexattr {
150
143
typedef struct pthread_mutexattr pthread_mutexattr_t ;
151
144
152
145
struct pthread_mutex {
153
- APTR mutex;
146
+ void * mutex ; // APTR
154
147
int kind ;
155
148
int incond ;
156
149
struct Task * owner ;
@@ -180,13 +173,13 @@ typedef struct pthread_condattr pthread_condattr_t;
180
173
181
174
struct pthread_cond {
182
175
int pad1 ;
183
- struct SignalSemaphore semaphore;
184
- struct MinList waiters;
176
+ void * semaphore ; // SignalSemaphore
177
+ void * waiters ; // MinList
185
178
};
186
179
187
180
typedef struct pthread_cond pthread_cond_t ;
188
181
189
- #define PTHREAD_COND_INITIALIZER {0 , NULL_SEMAPHORE, NULL_MINLIST }
182
+ #define PTHREAD_COND_INITIALIZER {0, 0, 0 }
190
183
191
184
//
192
185
// Barriers
@@ -200,12 +193,7 @@ struct pthread_barrierattr {
200
193
201
194
typedef struct pthread_barrierattr pthread_barrierattr_t ;
202
195
203
- struct pthread_barrier {
204
- unsigned int curr_height;
205
- unsigned int total_height;
206
- pthread_cond_t breeched;
207
- pthread_mutex_t lock;
208
- };
196
+ struct pthread_barrier ;
209
197
210
198
typedef struct pthread_barrier pthread_barrier_t ;
211
199
@@ -220,7 +208,7 @@ struct pthread_rwlockattr {
220
208
typedef struct pthread_rwlockattr pthread_rwlockattr_t ;
221
209
222
210
struct pthread_rwlock {
223
- struct SignalSemaphore semaphore;
211
+ void * semaphore ; // SignalSemaphore
224
212
};
225
213
226
214
typedef struct pthread_rwlock pthread_rwlock_t ;
@@ -414,11 +402,6 @@ extern void pthread_cleanup_pop(int execute);
414
402
415
403
extern int pthread_kill (pthread_t thread , int sig );
416
404
417
- #ifdef __cplusplus
418
- }
419
- #ifdef __USE_AMIGAOS_NAMESPACE__
420
- }
421
- #endif
422
- #endif
405
+ __END_DECLS
423
406
424
407
#endif
0 commit comments