schedule: create 'class Scheduler' with implementation 'class DefaultScheduler'
[model-checker.git] / model.cc
1 #include "model.h"
2 #include "schedule.h"
3 #include <stdlib.h>
4 #include <string.h>
5
6 ModelChecker *model;
7
8 ModelChecker::ModelChecker()
9 {
10         /* First thread created (system_thread) will have id 1 */
11         this->used_thread_id = 0;
12         /* Initialize default scheduler */
13         this->scheduler = new DefaultScheduler();
14 }
15
16 ModelChecker::~ModelChecker()
17 {
18         delete this->scheduler;
19 }
20
21 void ModelChecker::assign_id(struct thread *t)
22 {
23         t->id = ++this->used_thread_id;
24 }
25
26 void ModelChecker::add_system_thread(struct thread *t)
27 {
28         this->system_thread = t;
29 }