return ++used_thread_id;
}
-void ModelChecker::add_system_thread(Thread *t)
-{
- this->system_thread = t;
-}
-
Thread * ModelChecker::schedule_next_thread()
{
Thread *t;
continue;
/* Conflict from the same thread is not really a conflict */
if (id == prev->get_tid())
- return NULL;
+ continue;
return prev;
}
return NULL;
DEBUG("trying to push NULL action...\n");
return;
}
+ current_action = NULL;
nextThread = advance_backtracking_state();
next->set_node(currentNode);
set_backtracking(next);
int ModelChecker::switch_to_master(ModelAction *act)
{
- Thread *old, *next;
+ Thread *old;
DBG();
old = thread_current();
set_current_action(act);
old->set_state(THREAD_READY);
- next = system_thread;
- return old->swap(next);
+ return Thread::swap(old, get_system_context());
}
ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value)