projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
schedule: use STL 'queue' instead of 'list'
[model-checker.git]
/
schedule.h
diff --git
a/schedule.h
b/schedule.h
index ac69fa1163bfdfb3d8aff5a1f4ad249cdecb54e0..8e306752da7a1c43d7e10f8fb106473eb6284636 100644
(file)
--- a/
schedule.h
+++ b/
schedule.h
@@
-1,9
+1,26
@@
#ifndef __SCHEDULE_H__
#define __SCHEDULE_H__
#ifndef __SCHEDULE_H__
#define __SCHEDULE_H__
+#include <queue>
+
#include "libthreads.h"
#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);
-struct thread *schedule_choose_next(void);
+class DefaultScheduler: public Scheduler {
+public:
+ void add_thread(struct thread *t);
+ struct thread * next_thread(void);
+ struct thread * get_current_thread(void);
+private:
+ std::queue<struct thread *> queue;
+ struct thread *current;
+};
#endif /* __SCHEDULE_H__ */
#endif /* __SCHEDULE_H__ */