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();
15 this->current_action = NULL;
18 ModelChecker::~ModelChecker()
20 delete this->scheduler;
23 void ModelChecker::assign_id(struct thread *t)
25 t->id = ++this->used_thread_id;
28 void ModelChecker::add_system_thread(struct thread *t)
30 this->system_thread = t;
33 ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value)
35 struct thread *t = thread_current();
36 ModelAction *act = this;
45 void ModelAction::print(void)
50 type_str = "thread create";
53 type_str = "thread yield";
56 type_str = "thread join";
59 type_str = "atomic read";
62 type_str = "atomic write";
65 type_str = "unknown type";
68 printf("Thread: %d\tAction: %s\tMO: %d\tLoc: %#014zx\tValue: %d\n", tid, type_str, order, (size_t)location, value);