diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-08-27 18:11:26 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-08-27 18:11:26 -0700 |
commit | 50bff0c5fb8dc13987fcb4e9bf16432da1544740 (patch) | |
tree | 92af34a6fd39c5940775bee5c28babffe2eb5953 | |
parent | 2c0583aa194768129b87dc90814890c0dc712083 (diff) | |
download | mu-50bff0c5fb8dc13987fcb4e9bf16432da1544740.tar.gz |
3264
Turns out chessboard.mu started deadlocking in commit 3258 even though all its tests continue to pass. Not fixed yet; first make deadlock easier to diagnose.
-rw-r--r-- | 072scheduler.cc | 1 | ||||
-rw-r--r-- | 073wait.cc | 11 |
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 |