From 776279c18c4a4e6b763c4aeffc65fafe37205824 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 2 Apr 2013 16:53:52 -0700 Subject: [PATCH] action: add ModelAction::is_thread_join() helper --- action.cc | 5 +++++ action.h | 1 + model.cc | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/action.cc b/action.cc index 4de6f35..d425b60 100644 --- 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; diff --git a/action.h b/action.h index 61c7c4c..abf5531 100644 --- 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; diff --git a/model.cc b/model.cc index 0423c6e..e6f9afd 100644 --- 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); -- 2.34.1