about summary refs log tree commit diff stats
path: root/channel.mu
diff options
context:
space:
mode:
Diffstat (limited to 'channel.mu')
-rw-r--r--channel.mu7
1 files changed, 4 insertions, 3 deletions
diff --git a/channel.mu b/channel.mu
index 8e03cdc2..4fa6adaf 100644
--- a/channel.mu
+++ b/channel.mu
@@ -41,7 +41,8 @@
 (function main [
   (chan:channel-address <- init-channel 3:literal)
   ; create two background 'routines' that communicate by a channel
-  (fork consumer:fn nil:literal/globals nil:literal/limit chan:channel-address)
-  (fork producer:fn nil:literal/globals nil:literal/limit chan:channel-address)
-  (sleep for-some-cycles:literal 2000:literal)  ; wait for forked routines to effect the transfer
+  (routine1:integer <- fork consumer:fn nil:literal/globals nil:literal/limit chan:channel-address)
+  (routine2:integer <- fork producer:fn nil:literal/globals nil:literal/limit chan:channel-address)
+  (sleep until-routine-done:literal routine1:integer)
+  (sleep until-routine-done:literal routine2:integer)
 ])