X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=libthreads.h;h=b16c96be83dc4aab21b77f46b3579574a861c137;hb=6357baf85edec072a52c7ea18e9fdb087765f9cb;hp=f8a86cdfb5f24e2c42c28955fcc52a8dd2351cb2;hpb=6ac83ab66e4c564ffd0470ad25d5554eb5d52f28;p=model-checker.git diff --git a/libthreads.h b/libthreads.h index f8a86cd..b16c96b 100644 --- a/libthreads.h +++ b/libthreads.h @@ -1,26 +1,16 @@ #ifndef __LIBTHREADS_H__ #define __LIBTHREADS_H__ -#include -#include +typedef int thread_id_t; +typedef void (*thrd_start_t)(); -#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 +typedef thread_id_t thrd_t; -struct thread { - void (*start_routine); - void *arg; - ucontext_t context; - void *stack; - int index; - int completed; -}; +int thrd_create(thrd_t *t, thrd_start_t start_routine, void *arg); +int thrd_join(thrd_t); +int thrd_yield(void); +thrd_t thrd_current(void); -int thread_create(struct thread *t, void (*start_routine), void *arg); +extern void user_main(void); #endif /* __LIBTHREADS_H__ */