2011-08-06 12:07:39 -05:00
|
|
|
use std;
|
2011-12-13 18:25:51 -06:00
|
|
|
import comm;
|
|
|
|
import task;
|
2011-07-12 17:27:17 -05:00
|
|
|
|
2011-10-20 22:34:04 -05:00
|
|
|
fn start(c: comm::chan<comm::chan<int>>) {
|
2011-08-25 13:20:43 -05:00
|
|
|
let p: comm::port<int> = comm::port();
|
|
|
|
comm::send(c, comm::chan(p));
|
2011-08-06 12:07:39 -05:00
|
|
|
}
|
2010-08-11 17:05:33 -05:00
|
|
|
|
2011-04-19 15:35:49 -05:00
|
|
|
fn main() {
|
2011-08-25 13:20:43 -05:00
|
|
|
let p = comm::port();
|
2012-01-04 23:14:53 -06:00
|
|
|
let ch = comm::chan(p);
|
2012-06-30 18:19:07 -05:00
|
|
|
let child = task::spawn(|| start(ch) );
|
2011-08-25 13:20:43 -05:00
|
|
|
let c = comm::recv(p);
|
2011-08-06 12:07:39 -05:00
|
|
|
}
|