From 5d806b4bc80d6df106c78f47b336ef9d2aad7f3d Mon Sep 17 00:00:00 2001
From: Brian Norris <banorris@uci.edu>
Date: Mon, 15 Apr 2013 17:59:36 -0700
Subject: [PATCH] model: drop public get_current_node() interface

---
 model.cc    | 7 +------
 model.h     | 1 -
 schedule.cc | 7 +++++--
 schedule.h  | 2 +-
 4 files changed, 7 insertions(+), 10 deletions(-)

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;
-- 
2.34.1