9 ModelChecker::ModelChecker()
11 /* First thread created (system_thread) will have id 1 */
12 this->used_thread_id = 0;
13 /* Initialize default scheduler */
14 this->scheduler = new DefaultScheduler();
16 this->current_action = NULL;
19 ModelChecker::~ModelChecker()
21 delete this->scheduler;
24 void ModelChecker::assign_id(struct thread *t)
26 t->id = ++this->used_thread_id;
29 void ModelChecker::add_system_thread(struct thread *t)
31 this->system_thread = t;
34 void ModelChecker::check_current_action(void)
36 if (this->current_action)
37 this->action_trace.push_back(this->current_action);
39 DEBUG("trying to push NULL action...\n");
42 ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value)
44 struct thread *t = thread_current();
45 ModelAction *act = this;
54 void ModelAction::print(void)
59 type_str = "thread create";
62 type_str = "thread yield";
65 type_str = "thread join";
68 type_str = "atomic read";
71 type_str = "atomic write";
74 type_str = "unknown type";
77 printf("Thread: %d\tAction: %s\tMO: %d\tLoc: %#014zx\tValue: %d\n", tid, type_str, order, (size_t)location, value);