aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/basic-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/run-pass/basic-2.rs')
-rw-r--r--src/test/run-pass/basic-2.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/run-pass/basic-2.rs b/src/test/run-pass/basic-2.rs
new file mode 100644
index 00000000..975a0d4b
--- /dev/null
+++ b/src/test/run-pass/basic-2.rs
@@ -0,0 +1,26 @@
+// -*- rust -*-
+
+io fn a(chan[int] c) {
+ log "task a0";
+ log "task a1";
+ c <| 10;
+}
+
+io fn main() {
+ let port[int] p = port();
+ spawn a(chan(p));
+ spawn b(chan(p));
+ let int n = 0;
+ n <- p;
+ n <- p;
+ log "Finished.";
+}
+
+io fn b(chan[int] c) {
+ log "task b0";
+ log "task b1";
+ log "task b2";
+ log "task b2";
+ log "task b3";
+ c <| 10;
+}