model: drop public get_current_node() interface
authorBrian Norris <banorris@uci.edu>
Tue, 16 Apr 2013 00:59:36 +0000 (17:59 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 16 Apr 2013 01:20:02 +0000 (18:20 -0700)
model.cc
model.h
schedule.cc
schedule.h

index afb72b0aae490bda4a0464bb04837b380d81f4ca..c0f81ea077c25caf442a6c8117a29158f9adcc7a 100644 (file)
--- 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 f4961d80cfd70d31ff041c88b747cbc6794ab0da..3d1385596751c1ba13fd7016c8df2690921962d1 100644 (file)
--- 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);
        }
index 62ba8fb3ff0ee631d960649286142d0608560135..136f4622fb3ff1d16aa59a8b9d41a6c62df2f930 100644 (file)
@@ -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) {
index c18953d44824d09782e1cd389becbb96c181fb4c..4c67c28492b9cc24facc2e43827eee2ca198f28d 100644 (file)
@@ -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;