X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=model.cc;h=879f1dea17d162b38ca240e4c628043ed00001c3;hp=7df70eebbe271c88486a4c85e4289217f1a40e4b;hb=a11b6cce3a692a041cbfb772282a68be7949eb02;hpb=ab73aff1ea7d1b5b8140b361824580449a6b4398 diff --git a/model.cc b/model.cc index 7df70eeb..879f1dea 100644 --- a/model.cc +++ b/model.cc @@ -409,22 +409,6 @@ bool ModelChecker::is_deadlocked() const return blocking_threads; } -/** - * 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::is_circular_wait(const Thread *t) const -{ - for (Thread *waiting = t->waiting_on() ; waiting != NULL; waiting = waiting->waiting_on()) - if (waiting == t) - return true; - return false; -} - /** * Check if this is a complete execution. That is, have all thread completed * execution (rather than exiting because sleep sets have forced a redundant @@ -3169,7 +3153,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 (is_circular_wait(thr)) + if (thr->is_waiting_on(thr)) assert_bug("Deadlock detected"); } }