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 4de6f35..d425b60 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 61c7c4c..abf5531 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 0423c6e..e6f9afd 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);