aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/task-comm-15.rs
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-08-24 21:06:56 -0700
committerMichael Bebenita <[email protected]>2010-08-24 21:07:14 -0700
commit64ff82ecf98ceb4725f0f51c73e23d1efc2160bc (patch)
tree6a6ae7452066716947c4d262eb72041a6a11cb95 /src/test/run-pass/task-comm-15.rs
parentComment on env var required for std.dbg to do any logging. (diff)
downloadrust-64ff82ecf98ceb4725f0f51c73e23d1efc2160bc.tar.xz
rust-64ff82ecf98ceb4725f0f51c73e23d1efc2160bc.zip
Implemented an lock free queue based on this paper http://www.cs.rochester.edu/~scott/papers/1996_PODC_queues.pdf, the "lock free queue" we had before wasn't lock free at all.
Diffstat (limited to 'src/test/run-pass/task-comm-15.rs')
-rw-r--r--src/test/run-pass/task-comm-15.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/run-pass/task-comm-15.rs b/src/test/run-pass/task-comm-15.rs
new file mode 100644
index 00000000..8d748f59
--- /dev/null
+++ b/src/test/run-pass/task-comm-15.rs
@@ -0,0 +1,14 @@
+io fn start(chan[int] c, int n) {
+ let int i = n;
+
+ while(i > 0) {
+ c <| 0;
+ i = i - 1;
+ }
+}
+
+io fn main() {
+ let port[int] p = port();
+ auto child = spawn thread "child" start(chan(p), 10);
+ auto c <- p;
+} \ No newline at end of file