about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-04-22 23:23:51 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-22 23:23:51 -0700
commit10294369b9624383f757e93903f3eec2debb3474 (patch)
tree003bf4026bd42251d6ba23fcbb7fc4cf70e54cf6
parentd31037ffdcdb8097b91af121a27ef18c15f7e802 (diff)
downloadmu-10294369b9624383f757e93903f3eec2debb3474.tar.gz
2855
-rw-r--r--062scheduler.cc18
-rw-r--r--063wait.cc21
2 files changed, 21 insertions, 18 deletions
diff --git a/062scheduler.cc b/062scheduler.cc
index 00e6c58a..6ffe15b3 100644
--- a/062scheduler.cc
+++ b/062scheduler.cc
@@ -479,22 +479,12 @@ if (Passed && any_routines_with_error()) {
   raise << "some routines died with errors\n" << end();
   ++Num_failures;
 }
-if (Passed && any_routines_waiting()) {
-  Passed = false;
-  raise << "deadlock!\n" << end();
-  ++Num_failures;
-}
 :(before "End Mu Test Teardown")
 if (Passed && any_routines_with_error()) {
   Passed = false;
   raise << Current_scenario->name << ": some routines died with errors\n" << end();
   ++Num_failures;
 }
-if (Passed && any_routines_waiting()) {
-  Passed = false;
-  raise << Current_scenario->name << ": deadlock!\n" << end();
-  ++Num_failures;
-}
 
 :(code)
 bool any_routines_with_error() {
@@ -505,14 +495,6 @@ bool any_routines_with_error() {
   return false;
 }
 
-bool any_routines_waiting() {
-  for (int i = 0; i < SIZE(Routines); ++i) {
-    if (Routines.at(i)->state == WAITING)
-      return true;
-  }
-  return false;
-}
-
 :(before "End routine Fields")
 int limit;
 :(before "End routine Constructor")
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")