diff options
-rw-r--r-- | mu.arc | 2 | ||||
-rw-r--r-- | mu.arc.t | 6 |
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 |