projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
snapshot: fix EOL spaces
[model-checker.git]
/
schedule.h
diff --git
a/schedule.h
b/schedule.h
index bae8c1f8e2ce136206d42325dfbba6954e81c7c5..c99748c730a4812a303eecf2d30cfc0876a17bd5 100644
(file)
--- a/
schedule.h
+++ b/
schedule.h
@@
-1,19
+1,25
@@
#ifndef __SCHEDULE_H__
#define __SCHEDULE_H__
#ifndef __SCHEDULE_H__
#define __SCHEDULE_H__
-#include
"libthreads.h"
-#include "m
odel
.h"
+#include
<list>
+#include "m
ymemory
.h"
-struct scheduler {
- void (*init)(void);
- void (*exit)(void);
- void (*add_thread)(struct thread *t);
- struct thread * (*next_thread)(void);
- struct thread * (*get_current_thread)(void);
+/* Forward declaration */
+class Thread;
- void *priv;
-};
+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 scheduler_init(struct model_checker *mod);
+ MEMALLOC
+private:
+ std::list<Thread *, MyAlloc< Thread * > > readyList;
+ Thread *current;
+};
#endif /* __SCHEDULE_H__ */
#endif /* __SCHEDULE_H__ */