about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--072scheduler.cc1
-rw-r--r--073wait.cc11
2 files changed, 12 insertions, 0 deletions
diff --git a/072scheduler.cc b/072scheduler.cc
index 48b19635..cc38405b 100644
--- a/072scheduler.cc
+++ b/072scheduler.cc
@@ -69,6 +69,7 @@ void run(routine* rr) {
     // Scheduler Cleanup
     // End Scheduler Cleanup
   }
+  // End Run Routine
 }
 
 bool all_routines_done() {
diff --git a/073wait.cc b/073wait.cc
index 0d635cc3..e42df163 100644
--- a/073wait.cc
+++ b/073wait.cc
@@ -34,6 +34,11 @@ if (Passed && any_routines_waiting()) {
   Passed = false;
   raise << Current_scenario->name << ": deadlock!\n" << end();
 }
+:(before "End Run Routine")
+if (any_routines_waiting()) {
+  raise << "deadlock!\n" << end();
+  dump_waiting_routines();
+}
 :(before "End Test Teardown")
 if (Passed && any_routines_with_error()) {
   Passed = false;
@@ -47,6 +52,12 @@ bool any_routines_waiting() {
   }
   return false;
 }
+void dump_waiting_routines() {
+  for (int i = 0; i < SIZE(Routines); ++i) {
+    if (Routines.at(i)->state == WAITING)
+      cerr << i << ": " << routine_label(Routines.at(i)) << '\n';
+  }
+}
 
 //: primitive recipe to put routines in that state