about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-21 12:33:36 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-21 12:33:36 -0800
commitdf0485ae6ebe851e081cf1b7263a47d67a0cf67e (patch)
tree29a2a90a24d6435afea581ed81c576da96daa701 /mu.arc
parente612b44f76e6ab450d82bd34b584053052bd44af (diff)
downloadmu-df0485ae6ebe851e081cf1b7263a47d67a0cf67e.tar.gz
598 - clear up a minor mystery
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc9
1 files changed, 5 insertions, 4 deletions
diff --git a/mu.arc b/mu.arc
index e100d089..14ed973d 100644
--- a/mu.arc
+++ b/mu.arc
@@ -329,11 +329,8 @@
 ;   detect deadlock: kill all sleeping routines when none can be woken
 (def update-scheduler-state ()
   (when routine*
-;?     (prn routine*)
+;?     (prn "update scheduler state: " routine*)
     (if
-        empty.routine*
-          (do (trace "schedule" "done with routine")
-              (push routine* completed-routines*))
         rep.routine*!sleep
           (do (trace "schedule" "pushing " top.routine*!fn-name " to sleep queue")
               ; keep the clock ticking at rep.routine*!running-since
@@ -342,6 +339,9 @@
           (do (trace "schedule" "done with dead routine " top.routine*!fn-name)
 ;?               (tr rep.routine*)
               (push routine* completed-routines*))
+        empty.routine*
+          (do (trace "schedule" "done with routine")
+              (push routine* completed-routines*))
         (no rep.routine*!limit)
           (do (trace "schedule" "scheduling " top.routine*!fn-name " for further processing")
               (enq routine* running-routines*))
@@ -1461,6 +1461,7 @@
   (while (in top.routine!fn-name 'read 'write)
     (pop-stack routine))
   (wipe rep.routine!sleep)
+  (wipe rep.routine!error)
   (enq routine running-routines*))
 
 (def dump (msg routine)