66df5b1191cfa1d050d020c7bd3a01d3e4bd9fc3
[cdsspec-compiler.git] / include / threads.h
1 /** @file threads.h
2  *  @brief C11 Thread Library Functionality
3  */
4
5 #ifndef __THREADS_H__
6 #define __THREADS_H__
7
8 /* Forward declaration */
9 struct Thread; /* actually, class; but this is safe */
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15         typedef void (*thrd_start_t)(void *);
16
17         typedef struct {
18                 struct Thread *priv;
19         } thrd_t;
20
21         int thrd_create(thrd_t *t, thrd_start_t start_routine, void *arg);
22         int thrd_join(thrd_t);
23         void thrd_yield(void);
24         thrd_t thrd_current(void);
25
26         int user_main(int, char**);
27
28 #ifdef __cplusplus
29 }
30 #endif
31
32 #endif /* __THREADS_H__ */