schedule: add replaceable scheduler struct
[model-checker.git] / schedule.h
1 #ifndef __SCHEDULE_H__
2 #define __SCHEDULE_H__
3
4 #include "libthreads.h"
5 #include "model.h"
6
7 struct scheduler {
8         void (*init)(void);
9         void (*exit)(void);
10         void (*add_thread)(struct thread *t);
11         struct thread * (*next_thread)(void);
12         struct thread * (*get_current_thread)(void);
13
14         void *priv;
15 };
16
17 void scheduler_init(struct model_checker *mod);
18 void schedule_add_thread(struct thread *t);
19 struct thread *schedule_choose_next(void);
20
21 #endif /* __SCHEDULE_H__ */