datarace: make globals static
[cdsspec-compiler.git] / schedule.cc
index 1eb57d7515823012c51026db219af0e6e9bf0a77..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) {
@@ -250,7 +253,7 @@ void Scheduler::set_scheduler_thread(thread_id_t tid) {
  */
 void Scheduler::set_current_thread(Thread *t)
 {
-       ASSERT(t && !t->is_model_thread());
+       ASSERT(!t || !t->is_model_thread());
 
        current = t;
        if (DBG_ENABLED())