return ++priv->used_sequence_numbers;
}
-Node * ModelChecker::get_curr_node() const
-{
- return node_stack->get_head();
-}
-
/**
* @brief Select the next thread to execute based on the curren action
*
* scheduler decide
*/
if (diverge == NULL)
- return scheduler->select_next_thread();
+ return scheduler->select_next_thread(node_stack->get_head());
/* Else, we are trying to replay an execution */
ModelAction *next = node_stack->get_next()->get_action();
void assert_user_bug(const char *msg);
const model_params params;
- Node * get_curr_node() const;
void add_trace_analysis(TraceAnalysis *a) {
trace_analyses->push_back(a);
}
/**
* @brief Select a Thread to run via round-robin
+ *
+ * @param n The current Node, holding priority information for the next thread
+ * selection
+ *
* @return The next Thread to run
*/
-Thread * Scheduler::select_next_thread()
+Thread * Scheduler::select_next_thread(Node *n)
{
int old_curr_thread = curr_thread_index;
- Node *n = model->get_curr_node();
bool have_enabled_thread_with_priority = false;
if (model->params.fairwindow != 0) {
void remove_thread(Thread *t);
void sleep(Thread *t);
void wake(Thread *t);
- Thread * select_next_thread();
+ Thread * select_next_thread(Node *n);
void set_current_thread(Thread *t);
Thread * get_current_thread() const;
void print() const;