]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/acyclic-unwind.rs
Populate tree.
[rust.git] / src / test / run-pass / acyclic-unwind.rs
1 // -*- rust -*-
2
3 io fn f(chan[int] c)
4 {
5   type t = tup(int,int,int);
6
7   // Allocate an exterior.
8   let @t x = tup(1,2,3);
9
10   // Signal parent that we've allocated an exterior.
11   c <| 1;
12
13   while (true) {
14     // spin waiting for the parent to kill us.
15     log "child waiting to die...";
16     c <| 1;
17   }
18 }
19
20
21 io fn main() {
22   let port[int] p = port();
23   spawn f(chan(p));
24   let int i;
25
26   // synchronize on event from child.
27   i <- p;
28
29   log "parent exiting, killing child";
30 }