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
commite65c023309173aa291952143537f174888a8de86 (patch)
tree517b9c66d187dc97c0e7fbe181f43d9fefbef929 /tests/threads.ur
parentd52fbe487bb29a4a60dcca1d36e9dadc64917517 (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