schedule: make 'current' a private member of the scheduler
[model-checker.git] / schedule.h
index 801af0d839c7beb274aaadc66c719f627f2713a7..aa291ef8cd788872f14adce2f7199a6d3186f1de 100644 (file)
@@ -1,9 +1,26 @@
 #ifndef __SCHEDULE_H__
 #define __SCHEDULE_H__
 
+#include <list>
+
 #include "libthreads.h"
+#include "model.h"
+
+class Scheduler {
+public:
+       virtual void add_thread(struct thread *t) = 0;
+       virtual struct thread * next_thread(void) = 0;
+       virtual struct thread * get_current_thread(void) = 0;
+};
 
-void schedule_add_thread(struct thread *t);
-int schedule_choose_next(struct thread **t);
+class DefaultScheduler: public Scheduler {
+public:
+       void add_thread(struct thread *t);
+       struct thread * next_thread(void);
+       struct thread * get_current_thread(void);
+private:
+       std::list<struct thread *> queue;
+       struct thread *current;
+};
 
 #endif /* __SCHEDULE_H__ */