From 10294369b9624383f757e93903f3eec2debb3474 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 22 Apr 2016 23:23:51 -0700 Subject: 2855 --- 063wait.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to '063wait.cc') diff --git a/063wait.cc b/063wait.cc index 19bfb2d8..1adc9ad4 100644 --- a/063wait.cc +++ b/063wait.cc @@ -29,6 +29,27 @@ int old_value_of_waiting_location; :(before "End routine Constructor") waiting_on_location = old_value_of_waiting_location = 0; +:(before "End Mu Test Teardown") +if (Passed && any_routines_waiting()) { + Passed = false; + raise << Current_scenario->name << ": deadlock!\n" << end(); + ++Num_failures; +} +:(before "End Test Teardown") +if (Passed && any_routines_with_error()) { + Passed = false; + raise << "some routines died with errors\n" << end(); + ++Num_failures; +} +:(code) +bool any_routines_waiting() { + for (int i = 0; i < SIZE(Routines); ++i) { + if (Routines.at(i)->state == WAITING) + return true; + } + return false; +} + //: primitive recipe to put routines in that state :(before "End Primitive Recipe Declarations") -- cgit 1.4.1-2-gfad0