void ModelChecker::reset_to_initial_state()
{
DEBUG("+++ Resetting to initial state +++\n");
- std::map<thread_id_t, class Thread *>::iterator it;
+ std::map<int, class Thread *>::iterator it;
for (it = thread_map.begin(); it != thread_map.end(); it++)
delete (*it).second;
thread_map.clear();
Thread *t;
if (nextThread == THREAD_ID_T_NONE)
return NULL;
- t = thread_map[nextThread];
+ t = thread_map[id_to_int(nextThread)];
if (t == NULL)
DEBUG("*** error: thread not in thread_map: id = %d\n", nextThread);
return t;
int ModelChecker::add_thread(Thread *t)
{
- thread_map[t->get_id()] = t;
+ thread_map[id_to_int(t->get_id())] = t;
scheduler->add_thread(t);
return 0;
}
int add_thread(Thread *t);
void remove_thread(Thread *t);
- Thread * get_thread(thread_id_t tid) { return thread_map[tid]; }
+ Thread * get_thread(thread_id_t tid) { return thread_map[id_to_int(tid)]; }
thread_id_t get_next_id();
ucontext_t *system_context;
action_list_t *action_trace;
- std::map<thread_id_t, class Thread *> thread_map;
+ std::map<int, class Thread *> thread_map;
class TreeNode *rootNode, *currentNode;
std::list<class Backtrack *> backtrack_list;
};