8 ModelChecker::ModelChecker()
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();
16 ModelChecker::~ModelChecker()
18 delete this->scheduler;
21 void ModelChecker::assign_id(struct thread *t)
23 t->id = ++this->used_thread_id;
26 void ModelChecker::add_system_thread(struct thread *t)
28 this->system_thread = t;
31 ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value)
33 struct thread *t = thread_current();
34 ModelAction *act = this;
43 void ModelAction::print(void)
48 type_str = "thread create";
51 type_str = "thread yield";
54 type_str = "thread join";
57 type_str = "atomic read";
60 type_str = "atomic write";
63 type_str = "unknown type";
66 printf("Thread: %d\tAction: %s\tMO: %d\tLoc: %#014zx\tValue: %d\n", tid, type_str, order, (size_t)location, value);