libthreads: create header file
[model-checker.git] / libthreads.h
1 #include <stdio.h>
2
3 #ifdef CONFIG_DEBUG
4 #define DBG() do { printf("Here: %s, L%d\n", __func__, __LINE__); } while (0)
5 #define DEBUG(fmt, ...) printf(fmt, ##__VA_ARGS__)
6 #else
7 #define DBG()
8 #define DEBUG(fmt, ...)
9 #endif
10
11 struct thread {
12         void (*start_routine);
13         void *arg;
14         ucontext_t context;
15         void *stack;
16         int index;
17 };
18
19 int thread_create(struct thread *t, void (*start_routine), void *arg);
20 void thread_start(struct thread *t);