1e2df96292bf365d087d7a7d8fe8cf5405f56b87
[c11tester.git] / libthreads.h
1 #ifndef __LIBTHREADS_H__
2 #define __LIBTHREADS_H__
3
4 #include <ucontext.h>
5
6 struct thread {
7         void (*start_routine);
8         void *arg;
9         ucontext_t context;
10         void *stack;
11         int index;
12         int completed;
13 };
14
15 int thread_create(struct thread *t, void (*start_routine), void *arg);
16 void thread_join(struct thread *t);
17 int thread_yield(void);
18 struct thread *thread_current(void);
19
20 #endif /* __LIBTHREADS_H__ */