53 #define PTHREAD_CANCEL_DISABLE 0 54 #define PTHREAD_CANCEL_ENABLE 0x01 56 #define PTHREAD_CANCEL_DEFERRED 0 57 #define PTHREAD_CANCEL_ASYNCHRONOUS 0x02 59 #define PTHREAD_CREATE_JOINABLE 0 60 #define PTHREAD_CREATE_DETACHED 0x04 62 #define PTHREAD_EXPLICT_SCHED 0 63 #define PTHREAD_INHERIT_SCHED 0x08 65 #define PTHREAD_SCOPE_PROCESS 0 66 #define PTHREAD_SCOPE_SYSTEM 0x10 68 #define PTHREAD_DEFAULT_ATTR (PTHREAD_CANCEL_ENABLE) 70 #define PTHREAD_CANCELED ((void *) 0xDEADBEEF) 72 #define PTHREAD_ONCE_INIT 0 73 #define PTHREAD_MUTEX_INITIALIZER {(void*)-1,-1,0,0,0,0} 74 #define PTHREAD_RWLOCK_INITIALIZER {0} 75 #define PTHREAD_COND_INITIALIZER {0} 76 #define PTHREAD_BARRIER_INITIALIZER \ 77 {0,0,PTHREAD_MUTEX_INITIALIZER,PTHREAD_COND_INITIALIZER} 78 #define PTHREAD_SPINLOCK_INITIALIZER 0 80 #define PTHREAD_DESTRUCTOR_ITERATIONS 256 81 #define PTHREAD_KEYS_MAX (1<<20) 83 #define PTHREAD_MUTEX_NORMAL 0 84 #define PTHREAD_MUTEX_ERRORCHECK 1 85 #define PTHREAD_MUTEX_RECURSIVE 2 86 #define PTHREAD_MUTEX_DEFAULT 3 87 #define PTHREAD_MUTEX_SHARED 4 88 #define PTHREAD_MUTEX_PRIVATE 0 89 #define PTHREAD_PRIO_NONE 0 90 #define PTHREAD_PRIO_INHERIT 8 91 #define PTHREAD_PRIO_PROTECT 16 92 #define PTHREAD_PRIO_MULT 32 93 #define PTHREAD_PROCESS_SHARED 0 94 #define PTHREAD_PROCESS_PRIVATE 1 96 #define PTHREAD_BARRIER_SERIAL_THREAD 1 118 CONDITION_VARIABLE cv;
132 typedef long pthread_once_t;
133 typedef unsigned pthread_mutexattr_t;
134 typedef SRWLOCK pthread_rwlock_t;
135 typedef CRITICAL_SECTION pthread_mutex_t;
136 typedef unsigned pthread_key_t;
137 typedef void *pthread_barrierattr_t;
138 typedef long pthread_spinlock_t;
139 typedef int pthread_condattr_t;
140 typedef CONDITION_VARIABLE pthread_cond_t;
141 typedef int pthread_rwlockattr_t;
143 extern pthread_t pthread_self(
void);
145 extern int pthread_once(pthread_once_t *o,
void(*func)(
void));
147 extern int pthread_mutex_lock(pthread_mutex_t *m);
149 extern int pthread_mutex_unlock(pthread_mutex_t *m);
151 extern int pthread_mutex_trylock(pthread_mutex_t *m);
153 extern int pthread_mutex_init(pthread_mutex_t *m, pthread_mutexattr_t *a);
155 extern int pthread_mutex_destroy(pthread_mutex_t *m);
157 #define pthread_mutex_getprioceiling(M, P) ENOTSUP 158 #define pthread_mutex_setprioceiling(M, P) ENOTSUP 160 extern int pthread_equal(pthread_t t1, pthread_t t2);
162 extern int pthread_rwlock_init(pthread_rwlock_t *l, pthread_rwlockattr_t *a);
164 extern int pthread_rwlock_destroy(pthread_rwlock_t *l);
166 extern int pthread_rwlock_rdlock(pthread_rwlock_t *l);
168 extern int pthread_rwlock_wrlock(pthread_rwlock_t *l);
170 extern int pthread_rwlock_unlock(pthread_rwlock_t *l);
172 extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *l);
174 extern int pthread_rwlock_trywrlock(pthread_rwlock_t *l);
176 extern void pthread_tls_init(
void);
178 extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *l,
const struct timespec *ts);
180 extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *l,
const struct timespec *ts);
182 extern int pthread_get_concurrency(
int *val);
184 extern int pthread_set_concurrency(
int val);
186 #define pthread_getschedparam(T, P, S) ENOTSUP 187 #define pthread_setschedparam(T, P, S) ENOTSUP 188 #define pthread_getcpuclockid(T, C) ENOTSUP 190 extern int pthread_exit(
void *res);
192 extern void pthread_testcancel(
void);
194 extern int pthread_cancel(pthread_t t);
196 extern int pthread_attr_init(pthread_attr_t *attr);
198 extern int pthread_attr_destroy(pthread_attr_t *attr);
200 extern int pthread_attr_setdetachstate(pthread_attr_t *a,
int flag);
202 extern int pthread_attr_getdetachstate(pthread_attr_t *a,
int *flag);
204 extern int pthread_attr_setinheritsched(pthread_attr_t *a,
int flag);
206 extern int pthread_attr_getinheritsched(pthread_attr_t *a,
int *flag);
208 extern int pthread_attr_setscope(pthread_attr_t *a,
int flag);
210 extern int pthread_attr_getscope(pthread_attr_t *a,
int *flag);
212 extern int pthread_attr_getstackaddr(pthread_attr_t *attr,
void **stack);
214 extern int pthread_attr_setstackaddr(pthread_attr_t *attr,
void *stack);
216 extern int pthread_attr_getstacksize(pthread_attr_t *attr,
size_t *size);
218 extern int pthread_attr_setstacksize(pthread_attr_t *attr,
size_t size);
220 #define pthread_attr_getguardsize(A, S) ENOTSUP 221 #define pthread_attr_setgaurdsize(A, S) ENOTSUP 222 #define pthread_attr_getschedparam(A, S) ENOTSUP 223 #define pthread_attr_setschedparam(A, S) ENOTSUP 224 #define pthread_attr_getschedpolicy(A, S) ENOTSUP 225 #define pthread_attr_setschedpolicy(A, S) ENOTSUP 227 extern int pthread_setcancelstate(
int state,
int *oldstate);
229 extern int pthread_setcanceltype(
int type,
int *oldtype);
231 extern unsigned __stdcall pthread_create_wrapper(
void *args);
233 extern int pthread_create(pthread_t *th, pthread_attr_t *attr,
void *(*func)(
void *),
void *arg);
235 extern int pthread_join(pthread_t t,
void **res);
237 extern int pthread_detach(pthread_t t);
239 extern int pthread_mutexattr_init(pthread_mutexattr_t *a);
241 extern int pthread_mutexattr_destroy(pthread_mutexattr_t *a);
243 extern int pthread_mutexattr_gettype(pthread_mutexattr_t *a,
int *type);
245 extern int pthread_mutexattr_settype(pthread_mutexattr_t *a,
int type);
247 extern int pthread_mutexattr_getpshared(pthread_mutexattr_t *a,
int *type);
249 extern int pthread_mutexattr_setpshared(pthread_mutexattr_t * a,
int type);
251 extern int pthread_mutexattr_getprotocol(pthread_mutexattr_t *a,
int *type);
253 extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *a,
int type);
255 extern int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *a,
int * prio);
257 extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *a,
int prio);
259 extern int pthread_mutex_timedlock(pthread_mutex_t *m,
struct timespec *ts);
261 extern int pthread_barrier_destroy(pthread_barrier_t *b);
263 extern int pthread_barrier_init(pthread_barrier_t *b,
void *attr,
int count);
265 extern int pthread_barrier_wait(pthread_barrier_t *b);
267 extern int pthread_barrierattr_init(
void **attr);
269 extern int pthread_barrierattr_destroy(
void **attr);
271 extern int pthread_barrierattr_setpshared(
void **attr,
int s);
273 extern int pthread_barrierattr_getpshared(
void **attr,
int *s);
275 extern int pthread_key_create(pthread_key_t *key,
void(*dest)(
void *));
277 extern int pthread_key_delete(pthread_key_t key);
279 extern void *pthread_getspecific(pthread_key_t key);
281 extern int pthread_setspecific(pthread_key_t key,
const void *value);
283 extern int pthread_spin_init(pthread_spinlock_t *l,
int pshared);
285 extern int pthread_spin_destroy(pthread_spinlock_t *l);
287 extern int pthread_spin_lock(pthread_spinlock_t *l);
289 extern int pthread_spin_trylock(pthread_spinlock_t *l);
291 extern int pthread_spin_unlock(pthread_spinlock_t *l);
293 extern int pthread_cond_init(pthread_cond_t *c, pthread_condattr_t *a);
295 extern int pthread_cond_signal(pthread_cond_t *c);
297 extern int pthread_cond_broadcast(pthread_cond_t *c);
299 extern int pthread_cond_wait(pthread_cond_t *c, pthread_mutex_t *m);
301 extern int pthread_cond_destroy(pthread_cond_t *c);
303 extern int pthread_cond_timedwait(pthread_cond_t *c, pthread_mutex_t *m,
struct timespec *t);
305 extern int pthread_condattr_destroy(pthread_condattr_t *a);
307 #define pthread_condattr_getclock(A, C) ENOTSUP 308 #define pthread_condattr_setclock(A, C) ENOTSUP 310 extern int pthread_condattr_init(pthread_condattr_t *a);
312 extern int pthread_condattr_getpshared(pthread_condattr_t *a,
int *s);
314 extern int pthread_condattr_setpshared(pthread_condattr_t *a,
int s);
316 extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *a);
318 extern int pthread_rwlockattr_init(pthread_rwlockattr_t *a);
320 extern int pthread_rwlockattr_getpshared(pthread_rwlockattr_t *a,
int *s);
322 extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *a,
int s);
325 #define pthread_atfork(F1,F2,F3) 0 328 #define pthread_kill(T, S) 0 329 #define pthread_sigmask(H, S1, S2) 0