]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/task-comm-13.rs
port over the tests to use the new API
[rust.git] / src / test / run-pass / task-comm-13.rs
index c2a15229f88778ffc12c10f6f0ca122aec5c956b..dc2393d13f481b055fdaefcaed73916ef09c3d06 100644 (file)
@@ -3,8 +3,7 @@
 import comm;
 import comm::send;
 
-fn start(&&args: (comm::chan<int>, int, int)) {
-    let (c, start, number_of_messages) = args;
+fn start(c: comm::chan<int>, start: int, number_of_messages: int) {
     let i: int = 0;
     while i < number_of_messages { send(c, start + i); i += 1; }
 }
@@ -12,7 +11,8 @@ fn start(&&args: (comm::chan<int>, int, int)) {
 fn main() {
     #debug("Check that we don't deadlock.");
     let p = comm::port::<int>();
-    let a = task::spawn_joinable((comm::chan(p), 0, 10), start);
+    let ch = comm::chan(p);
+    let a = task::spawn_joinable {|| start(ch, 0, 10); };
     task::join(a);
     #debug("Joined task");
 }