X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=schedule.h;h=a7483e02340942cf773ea7a69c890d72b384f69a;hb=c451049894af068c8ba22011e3094e66a45d20c3;hp=f4965369b2a62be67a124ae29a44b4172c28f0eb;hpb=c400af2b7dfb87ce64c86f2d2b6a37d02421b263;p=model-checker.git diff --git a/schedule.h b/schedule.h index f496536..a7483e0 100644 --- a/schedule.h +++ b/schedule.h @@ -1,3 +1,7 @@ +/** @file schedule.h + * @brief Thread scheduler. + */ + #ifndef __SCHEDULE_H__ #define __SCHEDULE_H__ @@ -7,18 +11,25 @@ /* 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; };