-#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);
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__ */