For a particular ModelAction, the 'parent' may be the last action in the
current thread, or otherwise, the action in the parent thread that created the
current thread. This calculation is not suitable for within the NodeStack (and
the current implementation is wrong, taking the last action performed by *any*
thread as the parent). Thus, I set up the method calls to pass the 'parent' to
explore_action() and leave the details to further work.
return;
}
- curr = node_stack->explore_action(curr);
+ curr = node_stack->explore_action(curr, NULL);
nextThread = get_next_replay_thread();
currnode = curr->get_node();
printf("............................................\n");
}
-ModelAction * NodeStack::explore_action(ModelAction *act)
+ModelAction * NodeStack::explore_action(ModelAction *act, ModelAction *parent)
{
DBG();
/* Record action */
get_head()->explore_child(act);
- act->create_cv(get_head()->get_action());
+ act->create_cv(parent);
node_list.push_back(new Node(act, model->get_num_threads()));
iter++;
}
public:
NodeStack();
~NodeStack();
- ModelAction * explore_action(ModelAction *act);
+ ModelAction * explore_action(ModelAction *act, ModelAction *parent);
Node * get_head();
Node * get_next();
void reset_execution();