]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/lazychan.rs
Populate tree.
[rust.git] / src / test / run-pass / lazychan.rs
1 // -*- rust -*-
2
3 io fn main() {
4   let port[int] p = port();
5   auto c = chan(p);
6   let int y;
7
8   spawn child(c);
9   y <- p;
10   log "received 1";
11   log y;
12   check (y == 10);
13
14   spawn child(c);
15   y <- p;
16   log "received 2";
17   log y;
18   check (y == 10);
19 }
20
21 io fn child(chan[int] c) {
22   c <| 10;
23 }