]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-783.rs
086e652932084fd242d8862ce2635e8a8483c3e0
[rust.git] / src / test / run-pass / issue-783.rs
1 use std;
2 import comm::*;
3 import task::*;
4
5 fn a(&&_args: ()) {
6     fn doit() {
7         fn b(c: chan<chan<int>>) {
8             let p = port();
9             send(c, chan(p));
10         }
11         let p = port();
12         spawn(chan(p), b);
13         recv(p);
14     }
15     let i = 0;
16     while i < 100 {
17         doit();
18         i += 1;
19     }
20 }
21
22 fn main() {
23     let t = spawn_joinable((), a);
24     join(t);
25 }