schedule: use STL 'queue' instead of 'list'
[model-checker.git] / schedule.h
1 #ifndef __SCHEDULE_H__
2 #define __SCHEDULE_H__
3
4 #include <queue>
5
6 #include "libthreads.h"
7 #include "model.h"
8
9 class Scheduler {
10 public:
11         virtual void add_thread(struct thread *t) = 0;
12         virtual struct thread * next_thread(void) = 0;
13         virtual struct thread * get_current_thread(void) = 0;
14 };
15
16 class DefaultScheduler: public Scheduler {
17 public:
18         void add_thread(struct thread *t);
19         struct thread * next_thread(void);
20         struct thread * get_current_thread(void);
21 private:
22         std::queue<struct thread *> queue;
23         struct thread *current;
24 };
25
26 #endif /* __SCHEDULE_H__ */