9 typedef unsigned long thrd_t
;
11 typedef struct __pthread
*thrd_t
;
12 #define thread_local _Thread_local
15 typedef int once_flag
;
16 typedef unsigned tss_t
;
17 typedef int (*thrd_start_t
)(void *);
18 typedef void (*tss_dtor_t
)(void *);
23 #include <bits/alltypes.h>
25 #define TSS_DTOR_ITERATIONS 4
41 #define ONCE_FLAG_INIT 0
43 int thrd_create(thrd_t
*, thrd_start_t
, void *);
44 _Noreturn
void thrd_exit(int);
46 int thrd_detach(thrd_t
);
47 int thrd_join(thrd_t
, int *);
49 int thrd_sleep(const struct timespec
*, struct timespec
*);
50 void thrd_yield(void);
52 thrd_t
thrd_current(void);
53 int thrd_equal(thrd_t
, thrd_t
);
55 #define thrd_equal(A, B) ((A) == (B))
58 void call_once(once_flag
*, void (*)(void));
60 int mtx_init(mtx_t
*, int);
61 void mtx_destroy(mtx_t
*);
63 int mtx_lock(mtx_t
*);
64 int mtx_timedlock(mtx_t
*__restrict
, const struct timespec
*__restrict
);
65 int mtx_trylock(mtx_t
*);
66 int mtx_unlock(mtx_t
*);
68 int cnd_init(cnd_t
*);
69 void cnd_destroy(cnd_t
*);
71 int cnd_broadcast(cnd_t
*);
72 int cnd_signal(cnd_t
*);
74 int cnd_timedwait(cnd_t
*__restrict
, mtx_t
*__restrict
, const struct timespec
*__restrict
);
75 int cnd_wait(cnd_t
*, mtx_t
*);
77 int tss_create(tss_t
*, tss_dtor_t
);
78 void tss_delete(tss_t
);
80 int tss_set(tss_t
, void *);