summaryrefslogtreecommitdiff
path: root/tests/threads.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-16 13:00:40 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-16 13:00:40 -0400
commitb6fef1cc8832978bd9673df1a968d06d42bc2eb0 (patch)
tree517b9c66d187dc97c0e7fbe181f43d9fefbef929 /tests/threads.ur
parent966f716a755bd954d817b43d1efaaeb6f939ad89 (diff)
Avoid thread death via message receive
Diffstat (limited to 'tests/threads.ur')
-rw-r--r--tests/threads.ur18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/threads.ur b/tests/threads.ur
new file mode 100644
index 00000000..447b7a74
--- /dev/null
+++ b/tests/threads.ur
@@ -0,0 +1,18 @@
+fun main () =
+ buf <- Buffer.create;
+ let
+ fun loop1 () =
+ Buffer.write buf "A";
+ sleep 9;
+ loop1 ()
+
+ fun loop2 () =
+ Buffer.write buf "B";
+ sleep 9;
+ error <xml>Darn</xml>
+ loop2 ()
+ in
+ return <xml><body onload={spawn (loop1 ()); loop2 ()}>
+ <dyn signal={Buffer.render buf}/>
+ </body></xml>
+ end