action: add ModelAction::is_thread_join() helper
authorBrian Norris <banorris@uci.edu>
Tue, 2 Apr 2013 23:53:52 +0000 (16:53 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 2 Apr 2013 23:53:52 +0000 (16:53 -0700)
action.cc
action.h
model.cc

index 4de6f354bfbccfbedc9061538ecb48be8e69e3e2..d425b6030f9cdaaccc928b75ddad9169bcb4f70a 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -77,6 +77,11 @@ bool ModelAction::is_thread_start() const
        return type == THREAD_START;
 }
 
+bool ModelAction::is_thread_join() const
+{
+       return type == THREAD_JOIN;
+}
+
 bool ModelAction::is_relseq_fixup() const
 {
        return type == MODEL_FIXUP_RELSEQ;
index 61c7c4cb9f7b5c7ffc15d270792ad856cdfe80e8..abf55318cd3ba379ea198420fad4ce70bfc570ea 100644 (file)
--- a/action.h
+++ b/action.h
@@ -106,6 +106,7 @@ public:
        void set_seq_number(modelclock_t num);
        void set_try_lock(bool obtainedlock);
        bool is_thread_start() const;
+       bool is_thread_join() const;
        bool is_relseq_fixup() const;
        bool is_mutex_op() const;
        bool is_lock() const;
index 0423c6e3141e188238e55bf3f29bfc190b3d104c..e6f9afd9c6fd1d2b904e3ea4e23777198b71561f 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -1472,7 +1472,7 @@ bool ModelChecker::check_action_enabled(ModelAction *curr) {
                        get_safe_ptr_action(lock_waiters_map, curr->get_location())->push_back(curr);
                        return false;
                }
-       } else if (curr->get_type() == THREAD_JOIN) {
+       } else if (curr->is_thread_join()) {
                Thread *blocking = (Thread *)curr->get_location();
                if (!blocking->is_complete()) {
                        blocking->push_wait_list(curr);