about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-11-21 21:35:05 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-21 21:37:22 -0800
commit527a0ebef8808487a8d998362d44ad7983beba22 (patch)
treea6a63a6f7facfa62fe03902725c178afe0b002d3
parent4a007fd922d2a8dc1d67b1283a41f75e800e1cb4 (diff)
downloadmu-527a0ebef8808487a8d998362d44ad7983beba22.tar.gz
290 - how was channel-write-block *ever* working?!
Oh right, because I wasn't using default-scope when checking to wake up.
-rw-r--r--mu.arc2
-rw-r--r--mu.arc.t6
2 files changed, 6 insertions, 2 deletions
diff --git a/mu.arc b/mu.arc
index 88b8669c..754171b5 100644
--- a/mu.arc
+++ b/mu.arc
@@ -938,7 +938,7 @@
     (break-unless (full boolean))
     ((watch boolean-address) <- get-address (chan channel) (read-watch offset))
     ((watch boolean-address deref) <- copy (nil literal))
-    (sleep (watch boolean-address))
+    (sleep (watch boolean-address deref))
   }
   ((q tagged-value-array-address) <- get (chan channel) (circular-buffer offset))
   ((free integer-address) <- get-address (chan channel) (first-free offset))
diff --git a/mu.arc.t b/mu.arc.t
index 685e097e..29bfee42 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -2248,9 +2248,12 @@
       ; channel has capacity 1, but receives a second write
       ((1 channel-address deref) <- write (1 channel-address deref) (3 tagged-value-address deref)))))
 ;? (set dump-trace*)
-;? (= dump-trace* (obj whitelist '("run")))
+;? (= dump-trace* (obj whitelist '("run" "schedule" "addr")))
 (run 'main)
 ;? (prn int-canon.memory*)
+;? (prn running-routines*)
+;? (prn sleeping-routines*)
+;? (prn completed-routines*)
 ; second write should cause the routine to sleep, and
 ; the sole sleeping routine should trigger the deadlock detector
 (let routine (car completed-routines*)
@@ -2258,6 +2261,7 @@
             (no rep.routine!error)
             (~posmatch "deadlock" rep.routine!error))
     (prn "F - 'write' on full channel blocks (puts the routine to sleep until the channel gets data)")))
+;? (quit)
 
 ; But how will the sleeping routines wake up? Our scheduler can't watch for
 ; changes to arbitrary values, just tell us if a specific raw location becomes