thr->set_pending(priv->current_action);
}
}
- priv->current_action = NULL;
}
void ModelChecker::wake_up_sleeping_actions(ModelAction *curr)
/**
* Takes the next step in the execution, if possible.
+ * @param curr The current step to take
* @return Returns true (success) if a step was taken and false otherwise.
*/
-bool ModelChecker::take_step() {
+bool ModelChecker::take_step(ModelAction *curr)
+{
if (has_asserted())
return false;
- ModelAction *curr = priv->current_action;
- priv->current_action = NULL;
-
Thread *curr_thrd = get_thread(curr);
ASSERT(curr_thrd->get_state() == THREAD_READY);
Thread::swap(&system_context, t);
/* Wait for all threads to complete */
- while (take_step());
+ while (take_step(priv->current_action));
} while (next_execution());
print_stats();
bool read_from(ModelAction *act, const ModelAction *rf);
bool check_action_enabled(ModelAction *curr);
- bool take_step();
+ bool take_step(ModelAction *curr);
void check_recency(ModelAction *curr, const ModelAction *rf);
ModelAction * get_last_conflict(ModelAction *act);