aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/task-comm-0.rs
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-07-19 14:05:18 -0700
committerMichael Bebenita <[email protected]>2010-07-19 14:05:18 -0700
commit00d1465d13980fc3acf650f182ee0723fbda0e06 (patch)
treea73cf5f0f20c0bee6722b33d975eb930919fefdf /src/test/run-pass/task-comm-0.rs
parentAdd a test for an obvious-seeming (but not actually legal) kind of cast attem... (diff)
downloadrust-00d1465d13980fc3acf650f182ee0723fbda0e06.tar.xz
rust-00d1465d13980fc3acf650f182ee0723fbda0e06.zip
Added a message passing system based on lock free queues for inter-thread communication. Channels now buffer on the sending side, and no longer require blocking when sending. Lots of other refactoring and bug fixes.
Diffstat (limited to 'src/test/run-pass/task-comm-0.rs')
-rw-r--r--src/test/run-pass/task-comm-0.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/run-pass/task-comm-0.rs b/src/test/run-pass/task-comm-0.rs
new file mode 100644
index 00000000..5992ba5c
--- /dev/null
+++ b/src/test/run-pass/task-comm-0.rs
@@ -0,0 +1,19 @@
+io fn main() -> () {
+ test05();
+}
+
+io fn test05_start(chan[int] ch) {
+ ch <| 10;
+ ch <| 20;
+ ch <| 30;
+}
+
+io fn test05() {
+ let port[int] po = port();
+ let chan[int] ch = chan(po);
+ spawn test05_start(chan(po));
+ let int value <- po;
+ value <- po;
+ value <- po;
+ log value;
+}