aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/task-comm-13-thread.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/run-pass/task-comm-13-thread.rs')
-rw-r--r--src/test/run-pass/task-comm-13-thread.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/run-pass/task-comm-13-thread.rs b/src/test/run-pass/task-comm-13-thread.rs
new file mode 100644
index 00000000..0dab20ed
--- /dev/null
+++ b/src/test/run-pass/task-comm-13-thread.rs
@@ -0,0 +1,18 @@
+use std;
+import std._task;
+
+io fn start(chan[int] c, int start, int number_of_messages) {
+ let int i = 0;
+ while (i < number_of_messages) {
+ c <| start + i;
+ i += 1;
+ }
+}
+
+fn main() -> () {
+ log "Check that we don't deadlock.";
+ let port[int] p = port();
+ let task a = spawn thread "start" start(chan(p), 0, 10);
+ join a;
+ log "Joined Task";
+} \ No newline at end of file