From: Brian Demsky <bdemsky@uci.edu>
Date: Mon, 25 Feb 2013 07:28:21 +0000 (-0800)
Subject: repush changes
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3f77119600ac3aa246258dec2776056d09f8e4e0;p=c11tester.git

repush changes
---

diff --git a/model.cc b/model.cc
index cec59d52..24eb83db 100644
--- a/model.cc
+++ b/model.cc
@@ -282,6 +282,8 @@ Thread * ModelChecker::get_next_thread(ModelAction *curr)
 				earliest_diverge = prevnode->get_action();
 			}
 		}
+		/* Start the round robin scheduler from this thread id */
+		scheduler->set_scheduler_thread(tid);
 		/* The correct sleep set is in the parent node. */
 		execute_sleep_set();
 
diff --git a/schedule.cc b/schedule.cc
index 8dd13304..1bd1b0f9 100644
--- a/schedule.cc
+++ b/schedule.cc
@@ -207,6 +207,10 @@ Thread * Scheduler::select_next_thread()
 	return NULL;
 }
 
+void Scheduler::set_scheduler_thread(thread_id_t tid) {
+	curr_thread_index=id_to_int(tid);
+}
+
 /**
  * @brief Set the current "running" Thread
  * @param t Thread to run
diff --git a/schedule.h b/schedule.h
index 121da08d..0865310a 100644
--- a/schedule.h
+++ b/schedule.h
@@ -39,6 +39,7 @@ public:
 	bool is_enabled(const Thread *t) const;
 	bool is_enabled(thread_id_t tid) const;
 	bool is_sleep_set(const Thread *t) const;
+	void set_scheduler_thread(thread_id_t tid);
 
 	SNAPSHOTALLOC
 private: