There are executions under which we may call ModelChecker::check_current_action()
twice in a row without an acutal ModelAction (curren_action) being set in
between. This causes the previous action to be queued twice in our trace
listing.
This can be solved 2 ways:
(1) set current_action to NULL after processing it
(2) move all calls to check_current_action() under the THREAD_READY codepath,
so that we guarantee that some Thread pushed an Action back to the
model-checking system
I do both.
DEBUG("trying to push NULL action...\n");
return;
}
+ current_action = NULL;
nextThread = advance_backtracking_state();
next->set_node(currentNode);
set_backtracking(next);
Thread *curr, *next;
curr = thread_current();
- model->check_current_action();
if (curr) {
- if (curr->get_state() == THREAD_READY)
+ if (curr->get_state() == THREAD_READY) {
+ model->check_current_action();
model->scheduler->add_thread(curr);
- else if (curr->get_state() == THREAD_RUNNING)
+ } else if (curr->get_state() == THREAD_RUNNING)
/* Stopped while running; i.e., completed */
curr->complete();
else