From: Brian Norris Date: Tue, 16 Apr 2013 00:59:36 +0000 (-0700) Subject: model: drop public get_current_node() interface X-Git-Tag: oopsla2013~70 X-Git-Url: http://demsky.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=5d806b4bc80d6df106c78f47b336ef9d2aad7f3d model: drop public get_current_node() interface --- diff --git a/model.cc b/model.cc index afb72b0..c0f81ea 100644 --- a/model.cc +++ b/model.cc @@ -199,11 +199,6 @@ modelclock_t ModelChecker::get_next_seq_num() 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 * @@ -246,7 +241,7 @@ Thread * ModelChecker::get_next_thread() * 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(); diff --git a/model.h b/model.h index f4961d8..3d13855 100644 --- a/model.h +++ b/model.h @@ -104,7 +104,6 @@ public: 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); } diff --git a/schedule.cc b/schedule.cc index 62ba8fb..136f462 100644 --- a/schedule.cc +++ b/schedule.cc @@ -195,12 +195,15 @@ void Scheduler::wake(Thread *t) /** * @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) { diff --git a/schedule.h b/schedule.h index c18953d..4c67c28 100644 --- a/schedule.h +++ b/schedule.h @@ -29,7 +29,7 @@ public: 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;