about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-11-21 20:47:48 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-21 20:47:48 -0800
commit4a007fd922d2a8dc1d67b1283a41f75e800e1cb4 (patch)
treee3c08670c0ae6e3c28338ded42b83b95bafa8ccc /mu.arc
parent672cda7e1ce754dda4801a7411221f5ed80517fb (diff)
downloadmu-4a007fd922d2a8dc1d67b1283a41f75e800e1cb4.tar.gz
289 - finally back to deadlock detection
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc5
1 files changed, 3 insertions, 2 deletions
diff --git a/mu.arc b/mu.arc
index 0c6ea313..88b8669c 100644
--- a/mu.arc
+++ b/mu.arc
@@ -253,7 +253,8 @@
       (let next-wakeup-cycle (apply min (map [rep._!sleep 0] exact-sleeping-routines))
         (= curr-cycle* (+ 1 next-wakeup-cycle))
         (trace "schedule" "skipping to cycle " curr-cycle*)
-        (update-scheduler-state)))))
+        (update-scheduler-state))))
+  (detect-deadlock))
 
 (def detect-deadlock ()
   (when (and empty.running-routines*
@@ -262,7 +263,7 @@
     (each (routine _) sleeping-routines*
       (wipe sleeping-routines*.routine)
       (= rep.routine!error "deadlock detected")
-      (enq routine completed-routines*))))
+      (push routine completed-routines*))))
 
 (def die (msg)
   (= rep.routine*!error msg)