X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=schedule.h;h=a7483e02340942cf773ea7a69c890d72b384f69a;hb=942ca53513b4c50f3f73bc4b123c3552dbc71ca6;hp=c633b28987d7ef97da5d1130060021260e65b0f6;hpb=d48c1867f8e5b2a3f9695a6bc8f1b5394dcda8e7;p=cdsspec-compiler.git diff --git a/schedule.h b/schedule.h index c633b28..a7483e0 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 sleep(Thread *t); + 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; };