diverge(NULL),
nextThread(THREAD_ID_T_NONE),
action_trace(new action_list_t()),
+ thread_map(new std::map<int, class Thread *>),
node_stack(new NodeStack()),
next_backtrack(NULL)
{
ModelChecker::~ModelChecker()
{
std::map<int, class Thread *>::iterator it;
- for (it = thread_map.begin(); it != thread_map.end(); it++)
+ for (it = thread_map->begin(); it != thread_map->end(); it++)
delete (*it).second;
- thread_map.clear();
+ delete thread_map;
delete action_trace;
{
DEBUG("+++ Resetting to initial state +++\n");
std::map<int, class Thread *>::iterator it;
- for (it = thread_map.begin(); it != thread_map.end(); it++)
+ for (it = thread_map->begin(); it != thread_map->end(); it++)
delete (*it).second;
- thread_map.clear();
+ thread_map->clear();
delete action_trace;
action_trace = new action_list_t();
node_stack->reset_execution();
Thread *t;
if (nextThread == THREAD_ID_T_NONE)
return NULL;
- t = thread_map[id_to_int(nextThread)];
+ t = (*thread_map)[id_to_int(nextThread)];
ASSERT(t != NULL);
int ModelChecker::add_thread(Thread *t)
{
- thread_map[id_to_int(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[id_to_int(tid)]; }
+ Thread * get_thread(thread_id_t tid) { return (*thread_map)[id_to_int(tid)]; }
thread_id_t get_next_id();
int get_next_seq_num();
ucontext_t *system_context;
action_list_t *action_trace;
- std::map<int, class Thread *> thread_map;
+ std::map<int, class Thread *> *thread_map;
class NodeStack *node_stack;
ModelAction *next_backtrack;
};