X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=schedule.h;h=664b2d245bea0b05a3f072d9c0eb75146bdfaf0f;hp=aa50ac3705f93a82ec397c56fcb66de9ad04dc75;hb=f2a014110185c734180545ffc1dc2f0dcd30fd0c;hpb=f6c3c97520fa724c97c6a04eb8da4bf8a4bb2477 diff --git a/schedule.h b/schedule.h index aa50ac3..664b2d2 100644 --- a/schedule.h +++ b/schedule.h @@ -1,18 +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); - Thread * next_thread(void); - Thread * get_current_thread(void); + void remove_thread(Thread *t); + 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; };