model: move get_thread() implementations out of header
authorBrian Norris <banorris@uci.edu>
Wed, 3 Oct 2012 20:37:02 +0000 (13:37 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 3 Oct 2012 20:39:13 +0000 (13:39 -0700)
model.cc
model.h

index 9371b89676846d13d310412fb9ac4840c61862fb..b5843ed6b7c5ebf6ba091e05afac6ac70593e1ae 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -1690,6 +1690,26 @@ void ModelChecker::remove_thread(Thread *t)
        scheduler->remove_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
 /**
  * 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 8e57876dabf3950e9cd3378eb15d50085a044d73..3802b9e2945e7dc8b30169f2bb23cb4edac083f7 100644 (file)
--- a/model.h
+++ b/model.h
@@ -73,8 +73,8 @@ public:
 
        void add_thread(Thread *t);
        void remove_thread(Thread *t);
 
        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();
 
        thread_id_t get_next_id();
        int get_num_threads();