about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-11-08 10:26:42 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-08 10:26:42 -0800
commit3bec25ce266aef848fb2a87b9a9ee33ab80566b0 (patch)
tree50870671d21189ae85460f3067ced2191bc5f82c
parentf182752578c4e5b06b1fe15bfcae007797c1ce2d (diff)
downloadmu-3bec25ce266aef848fb2a87b9a9ee33ab80566b0.tar.gz
262
-rw-r--r--mu.arc8
1 files changed, 4 insertions, 4 deletions
diff --git a/mu.arc b/mu.arc
index ef5cb539..d9d6321b 100644
--- a/mu.arc
+++ b/mu.arc
@@ -869,9 +869,9 @@
   ((val tagged-value) <- arg)
   { begin
     ((full boolean) <- full? (chan channel))
+    ; race condition: might unnecessarily sleep if consumer routine reads from
+    ; channel between previous check and the set to watch below
     (break-unless (full boolean))
-    ; todo: race condition: what if consumer routine reads between previous
-    ; instruction and next?
     ((watch boolean-address) <- get-address (chan channel) (read-watch offset))
     ((watch boolean-address deref) <- copy (nil literal))
     (sleep (watch boolean-address))
@@ -896,9 +896,9 @@
   ((chan channel) <- arg)
   { begin
     ((empty boolean) <- empty? (chan channel))
+    ; race condition: might unnecessarily sleep if consumer routine writes to
+    ; channel between previous check and the set to watch below
     (break-unless (empty boolean))
-    ; todo: race condition: what if producer routine writes between previous
-    ; instruction and next?
     ((watch boolean-address) <- get-address (chan channel) (write-watch offset))
     ((watch boolean-address deref) <- copy (nil literal))
     (sleep (watch boolean-address deref))