model: remove redundant code (is_enabled)
authorBrian Norris <banorris@uci.edu>
Wed, 5 Jun 2013 23:31:41 +0000 (16:31 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 5 Jun 2013 23:31:41 +0000 (16:31 -0700)
These members should just stay implemented in execution.{cc,h}, not
model.{cc,h}.

model.cc
model.h

index 16d5db4ab280262d1c4439de6544a413f8ba794e..5625f30ca8b637e362ebe49203394e52fe9d9e11 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -350,26 +350,6 @@ Thread * ModelChecker::get_thread(const ModelAction *act) const
        return execution->get_thread(act);
 }
 
        return execution->get_thread(act);
 }
 
-/**
- * @brief Check if a Thread is currently enabled
- * @param t The Thread to check
- * @return True if the Thread is currently enabled
- */
-bool ModelChecker::is_enabled(Thread *t) const
-{
-       return scheduler->is_enabled(t);
-}
-
-/**
- * @brief Check if a Thread is currently enabled
- * @param tid The ID of the Thread to check
- * @return True if the Thread is currently enabled
- */
-bool ModelChecker::is_enabled(thread_id_t tid) const
-{
-       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
 /**
  * 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
@@ -458,7 +438,7 @@ void ModelChecker::run()
                        for (unsigned int i = 0; i < get_num_threads(); i++) {
                                Thread *th = get_thread(int_to_id(i));
                                ModelAction *act = th->get_pending();
                        for (unsigned int i = 0; i < get_num_threads(); i++) {
                                Thread *th = get_thread(int_to_id(i));
                                ModelAction *act = th->get_pending();
-                               if (act && is_enabled(th) && !execution->check_action_enabled(act)) {
+                               if (act && execution->is_enabled(th) && !execution->check_action_enabled(act)) {
                                        scheduler->sleep(th);
                                }
                        }
                                        scheduler->sleep(th);
                                }
                        }
diff --git a/model.h b/model.h
index 25e20b129dc6b5280fc28af939495b713c7b1971..74cb4e1f29aaf2c649fce027fc9dd10c714eb562 100644 (file)
--- a/model.h
+++ b/model.h
@@ -57,9 +57,6 @@ public:
        Thread * get_thread(thread_id_t tid) const;
        Thread * get_thread(const ModelAction *act) const;
 
        Thread * get_thread(thread_id_t tid) const;
        Thread * get_thread(const ModelAction *act) const;
 
-       bool is_enabled(Thread *t) const;
-       bool is_enabled(thread_id_t tid) const;
-
        Thread * get_current_thread() const;
 
        void switch_from_master(Thread *thread);
        Thread * get_current_thread() const;
 
        void switch_from_master(Thread *thread);