common.h: move common code (non-user) to header
[model-checker.git] / libthreads.h
index 8522871771aeb7f7569e3df819581b449f2e75d9..0201ea616eb8842f4f3e86a2d7001421a3cb8252 100644 (file)
@@ -1,12 +1,7 @@
-#include <stdio.h>
+#ifndef __LIBTHREADS_H__
+#define __LIBTHREADS_H__
 
-#ifdef CONFIG_DEBUG
-#define DBG() do { printf("Here: %s, L%d\n", __func__, __LINE__); } while (0)
-#define DEBUG(fmt, ...) printf(fmt, ##__VA_ARGS__)
-#else
-#define DBG()
-#define DEBUG(fmt, ...)
-#endif
+#include <ucontext.h>
 
 struct thread {
        void (*start_routine);
@@ -14,7 +9,11 @@ struct thread {
        ucontext_t context;
        void *stack;
        int index;
+       int completed;
 };
 
 int thread_create(struct thread *t, void (*start_routine), void *arg);
-void thread_start(struct thread *t);
+void thread_join(struct thread *t);
+struct thread *thread_current(void);
+
+#endif /* __LIBTHREADS_H__ */