X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=model.cc;h=b5843ed6b7c5ebf6ba091e05afac6ac70593e1ae;hb=d1ea44cf0feb35d7d44b81bd26b49ecbfecccb83;hp=9371b89676846d13d310412fb9ac4840c61862fb;hpb=822674ef74d355637bc3ab2dda6fb63322a1f367;p=model-checker.git diff --git a/model.cc b/model.cc index 9371b89..b5843ed 100644 --- a/model.cc +++ b/model.cc @@ -1690,6 +1690,26 @@ void ModelChecker::remove_thread(Thread *t) scheduler->remove_thread(t); } +/** + * @brief Get a Thread reference by its ID + * @param tid The Thread's ID + * @return A Thread reference + */ +Thread * ModelChecker::get_thread(thread_id_t tid) +{ + return thread_map->get(id_to_int(tid)); +} + +/** + * @brief Get a reference to the Thread in which a ModelAction was executed + * @param act The ModelAction + * @return A Thread reference + */ +Thread * ModelChecker::get_thread(ModelAction *act) +{ + return get_thread(act->get_tid()); +} + /** * 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