It doesn't really make sense to have NodeStack call the 'create_cv' function
for a ModelAction. This commit separates the functionality of 'explore_action'
from 'create_cv', calling each separately from the higher-level
'check_current_action' model-checking function.
void ModelAction::create_cv(ModelAction *parent)
{
- ASSERT(cv == NULL);
+ if (cv)
+ return;
+
if (parent)
cv = new ClockVector(parent->cv, this);
else
return;
}
- curr = node_stack->explore_action(curr, get_parent_action(curr->get_tid()));
+ curr = node_stack->explore_action(curr);
+ curr->create_cv(get_parent_action(curr->get_tid()));
/* Assign 'creation' parent */
if (curr->get_type() == THREAD_CREATE) {
printf("............................................\n");
}
-ModelAction * NodeStack::explore_action(ModelAction *act, ModelAction *parent)
+ModelAction * NodeStack::explore_action(ModelAction *act)
{
DBG();
/* Record action */
get_head()->explore_child(act);
- 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 *parent);
+ ModelAction * explore_action(ModelAction *act);
Node * get_head();
Node * get_next();
void reset_execution();