model: implement, use schedule_next_thread()
[model-checker.git] / model.cc
index 4307b392b3e15c6be1e837d07a9baae31aaee3e0..26fd6cae0c6f33b04c3c2e3139f8bdc03f56565c 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -39,6 +39,17 @@ void ModelChecker::add_system_thread(Thread *t)
        this->system_thread = t;
 }
 
+Thread *ModelChecker::schedule_next_thread()
+{
+       Thread *t;
+       if (nextThread == THREAD_ID_T_NONE)
+               return NULL;
+       t = thread_map[nextThread];
+       if (t == NULL)
+               DEBUG("*** error: thread not in thread_map: id = %d\n", nextThread);
+       return t;
+}
+
 ModelAction *ModelChecker::get_last_conflict(ModelAction *act)
 {
        void *loc = act->get_location();