return scheduler->is_enabled(tid);
}
+/**
+ * Switch from a model-checker context to a user-thread context. This is the
+ * complement of ModelChecker::switch_to_master and must be called from the
+ * model-checker context
+ *
+ * @param thread The user-thread to switch to
+ */
+void ModelChecker::switch_from_master(Thread *thread)
+{
+ scheduler->next_thread(thread);
+ Thread::swap(&system_context, thread);
+}
+
/**
* Switch from a user-context to the "master thread" context (a.k.a. system
* context). This switch is made with the intention of exploring a particular
thread_id_t tid = int_to_id(i);
Thread *thr = get_thread(tid);
if (!thr->is_model_thread() && !thr->is_complete() && !thr->get_pending()) {
- scheduler->next_thread(thr);
- Thread::swap(&system_context, thr);
+ switch_from_master(thr);
}
}
unsigned int get_num_threads() const;
Thread * get_current_thread() const;
+ void switch_from_master(Thread *thread);
uint64_t switch_to_master(ModelAction *act);
ClockVector * get_cv(thread_id_t tid) const;
ModelAction * get_parent_action(thread_id_t tid) const;