From 664f78de4c437f087e5d0cf0b893a95cf7c50072 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Sun, 3 Mar 2013 14:12:31 -0800 Subject: [PATCH] model: rename check_deadlock() to is_circular_wait() This method doesn't check all deadlock situations, just circular waits. --- model.cc | 10 +++++----- model.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/model.cc b/model.cc index 7a5edc7..c713d1e 100644 --- a/model.cc +++ b/model.cc @@ -401,14 +401,14 @@ bool ModelChecker::is_deadlocked() const } /** - * Check if a Thread has entered a deadlock situation. This will not check - * other threads for potential deadlock situations, and may miss deadlocks - * involving WAIT. + * Check if a Thread has entered a circular wait deadlock situation. This will + * not check other threads for potential deadlock situations, and may miss + * deadlocks involving WAIT. * * @param t The thread which may have entered a deadlock * @return True if this Thread entered a deadlock; false otherwise */ -bool ModelChecker::check_deadlock(const Thread *t) const +bool ModelChecker::is_circular_wait(const Thread *t) const { for (Thread *waiting = t->waiting_on() ; waiting != NULL; waiting = waiting->waiting_on()) if (waiting == t) @@ -3052,7 +3052,7 @@ void ModelChecker::run() Thread *thr = get_thread(tid); if (!thr->is_model_thread() && !thr->is_complete() && !thr->get_pending()) { switch_from_master(thr); - if (check_deadlock(thr)) + if (is_circular_wait(thr)) assert_bug("Deadlock detected"); } } diff --git a/model.h b/model.h index 0cbff4c..ae668b1 100644 --- a/model.h +++ b/model.h @@ -276,7 +276,7 @@ private: bool is_feasible_prefix_ignore_relseq() const; bool is_infeasible() const; bool is_deadlocked() const; - bool check_deadlock(const Thread *t) const; + bool is_circular_wait(const Thread *t) const; bool is_complete_execution() const; bool have_bug_reports() const; void print_bugs() const; -- 2.34.1