about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--mu.arc11
-rw-r--r--mu.arc.t4
2 files changed, 11 insertions, 4 deletions
diff --git a/mu.arc b/mu.arc
index 754171b5..79ee4210 100644
--- a/mu.arc
+++ b/mu.arc
@@ -184,8 +184,9 @@
     (> curr-cycle* rep.routine!sleep.0)
     (ret result nil
       (= routine* routine)
-;?       (tr "checking location " rep.routine*!sleep)
+;?       (tr "checking location " rep.routine*!sleep " -> " (addr rep.routine*!sleep))
       (= result (~in (m rep.routine!sleep) 0 nil))
+;?       (tr (if result "yep" "nope"))
       (= routine* nil))))
 
 (on-init
@@ -229,6 +230,7 @@
 ;   wake up any necessary sleeping routines (either by time or on a location)
 ;   detect deadlock: kill all sleeping routines when none can be woken
 (def update-scheduler-state ()
+;?   (trace "schedule" curr-cycle*)
   (when routine*
     (if
         rep.routine*!sleep
@@ -257,7 +259,8 @@
   (detect-deadlock))
 
 (def detect-deadlock ()
-  (when (and empty.running-routines*
+  (when (and (empty running-routines*)
+             (~empty sleeping-routines*)
              (~some 'literal (map (fn(_) rep._!sleep.1)
                                   keys.sleeping-routines*)))
     (each (routine _) sleeping-routines*
@@ -555,7 +558,9 @@
                       (let delay v.operand
                         (trace "run" "sleeping until " (+ curr-cycle* delay))
                         (= rep.routine*!sleep `(,(+ curr-cycle* delay) literal)))
-                      (= rep.routine*!sleep operand))
+                      (do
+;?                         (tr "blocking on " operand " -> " (addr operand))
+                        (= rep.routine*!sleep operand)))
                     ((abort-routine*)))
 
                 ; text interaction
diff --git a/mu.arc.t b/mu.arc.t
index 29bfee42..3740a1b7 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -2316,7 +2316,9 @@
       ((ochan channel-address) <- arg)
       ((x tagged-value-address) <- new-tagged-value (integer-address literal) (n integer-address))
       ((ochan channel-address deref) <- write (ochan channel-address deref) (x tagged-value-address deref)))))
-;? (= dump-trace* (obj whitelist '("run")))
+(set dump-trace*)
+;? (= dump-trace* (obj whitelist '("schedule" "run" "addr")))
+;? (= dump-trace* (obj whitelist '("-")))
 (run 'f1)
 ;? (prn memory*)
 (each routine completed-routines*