2 Copyright (C) 2014 Szilard Biro
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
24 #include <aros/symbolsets.h>
25 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \
26 (tv)->tv_sec = (ts)->tv_sec; \
27 (tv)->tv_usec = (ts)->tv_nsec / 1000; }
29 #include <constructor.h>
30 #define StackSwapArgs PPCStackSwapArgs
31 #define NewStackSwap NewPPCStackSwap
36 #define SIGB_PARENT SIGBREAKB_CTRL_F
37 #define SIGF_PARENT (1 << SIGB_PARENT)
38 #define SIGB_COND_FALLBACK SIGBREAKB_CTRL_E
39 #define SIGF_COND_FALLBACK (1 << SIGB_COND_FALLBACK)
40 #define SIGB_TIMER_FALLBACK SIGBREAKB_CTRL_D
41 #define SIGF_TIMER_FALLBACK (1 << SIGB_TIMER_FALLBACK)
44 #define PTHREAD_FIRST_THREAD_ID (1)
45 #define PTHREAD_BARRIER_FLAG (1UL << 31)
56 void (*destructor
)(void *);
63 void (*routine
)(void *);
69 void *(*start
)(void *);
77 void *tlsvalues
[PTHREAD_KEYS_MAX
];
78 struct MinList cleanup
;
85 extern ThreadInfo threads
[PTHREAD_THREADS_MAX
];
86 extern struct SignalSemaphore thread_sem
;
87 extern TLSKey tlskeys
[PTHREAD_KEYS_MAX
];
88 extern struct SignalSemaphore tls_sem
;
91 extern pthread_t
GetThreadId(struct Task
*task
);
92 extern ThreadInfo
*GetThreadInfo(pthread_t thread
);
93 extern int SemaphoreIsInvalid(struct SignalSemaphore
*sem
);
94 extern int SemaphoreIsMine(struct SignalSemaphore
*sem
);
97 extern int _pthread_cond_timedwait(pthread_cond_t
*cond
, pthread_mutex_t
*mutex
, const struct timespec
*abstime
, BOOL relative
);
100 extern int _pthread_cond_broadcast(pthread_cond_t
*cond
, BOOL onlyfirst
);
103 extern int _pthread_mutex_init(pthread_mutex_t
*mutex
, const pthread_mutexattr_t
*attr
, BOOL staticinit
);