X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=schedule.h;h=664b2d245bea0b05a3f072d9c0eb75146bdfaf0f;hp=c633b28987d7ef97da5d1130060021260e65b0f6;hb=50b95c3747f4fe79b2ab1a1a6fc303224e16e418;hpb=d48c1867f8e5b2a3f9695a6bc8f1b5394dcda8e7 diff --git a/schedule.h b/schedule.h index c633b28..664b2d2 100644 --- a/schedule.h +++ b/schedule.h @@ -1,20 +1,35 @@ +/** @file schedule.h + * @brief Thread scheduler. + */ + #ifndef __SCHEDULE_H__ #define __SCHEDULE_H__ #include +#include "mymemory.h" -#include "threads.h" -#include "model.h" +/* Forward declaration */ +class Thread; +/** @brief The Scheduler class performs the mechanics of Thread execution + * scheduling. */ class Scheduler { public: + Scheduler(); void add_thread(Thread *t); void remove_thread(Thread *t); - Thread * next_thread(void); - Thread * get_current_thread(void); - void print(); + void wait(Thread *wait, Thread *join); + void wake(Thread *t); + Thread * next_thread(Thread *t); + Thread * get_current_thread() const; + void print() const; + + SNAPSHOTALLOC private: + /** The list of available Threads that are not currently running */ std::list readyList; + + /** The currently-running Thread */ Thread *current; };