X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=schedule.h;h=64531b5e94eb5023887b6779bcd5acb132bc82df;hb=92c74d06dcde4d3cfc8d3ba9c59f5b7266e1addf;hp=360b390512b4776d0af54eb331aa91682c4906c0;hpb=3ffc7186fd49a2dd2a5f5756511614fb3f06ac56;p=cdsspec-compiler.git diff --git a/schedule.h b/schedule.h index 360b390..64531b5 100644 --- a/schedule.h +++ b/schedule.h @@ -1,21 +1,19 @@ #ifndef __SCHEDULE_H__ #define __SCHEDULE_H__ -#include "libthreads.h" -#include "model.h" +#include -struct scheduler { - void (*init)(void); - void (*exit)(void); - void (*add_thread)(struct thread *t); - struct thread * (*next_thread)(void); - struct thread * (*get_current_thread)(void); +#include "threads.h" +#include "model.h" - void *priv; +class Scheduler { +public: + void add_thread(Thread *t); + Thread * next_thread(void); + Thread * get_current_thread(void); +private: + std::queue queue; + Thread *current; }; -void scheduler_init(struct model_checker *mod); -void schedule_add_thread(struct thread *t); -struct thread *schedule_choose_next(void); - #endif /* __SCHEDULE_H__ */