Relies on the rest of the model checker to set the next thread; simply returns
the chosen thread.
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();
Thread *Scheduler::next_thread(void)
{
+ Thread *t = model->schedule_next_thread();
+
+ if (t != NULL) {
+ readyList.remove(t);
+ return t;
+ }
if (readyList.empty())
return NULL;