From d1ea44cf0feb35d7d44b81bd26b49ecbfecccb83 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 3 Oct 2012 13:37:02 -0700 Subject: [PATCH] model: move get_thread() implementations out of header --- model.cc | 20 ++++++++++++++++++++ model.h | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/model.cc b/model.cc index 9371b896..b5843ed6 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 diff --git a/model.h b/model.h index 8e57876d..3802b9e2 100644 --- a/model.h +++ b/model.h @@ -73,8 +73,8 @@ public: void add_thread(Thread *t); void remove_thread(Thread *t); - Thread * get_thread(thread_id_t tid) { return thread_map->get(id_to_int(tid)); } - Thread * get_thread(ModelAction *act) { return get_thread(act->get_tid()); } + Thread * get_thread(thread_id_t tid); + Thread * get_thread(ModelAction *act); thread_id_t get_next_id(); int get_num_threads(); -- 2.34.1