2012-09-05 12:32:05 -07:00
|
|
|
use task::*;
|
|
|
|
use comm::*;
|
2012-05-22 14:10:32 -07:00
|
|
|
|
2012-08-15 18:46:55 -07:00
|
|
|
struct test {
|
2012-09-06 19:40:15 -07:00
|
|
|
f: int,
|
2012-06-01 14:48:02 -07:00
|
|
|
drop {}
|
2012-05-22 14:10:32 -07:00
|
|
|
}
|
|
|
|
|
2012-09-05 15:58:43 -07:00
|
|
|
fn test(f: int) -> test {
|
|
|
|
test {
|
|
|
|
f: f
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-22 14:10:32 -07:00
|
|
|
fn main() {
|
2012-08-27 14:22:25 -07:00
|
|
|
let p = Port();
|
|
|
|
let c = Chan(p);
|
2012-05-22 14:10:32 -07:00
|
|
|
|
2012-07-04 15:04:28 -04:00
|
|
|
do spawn() {
|
2012-08-27 14:22:25 -07:00
|
|
|
let p = Port();
|
|
|
|
c.send(Chan(p));
|
2012-05-22 14:10:32 -07:00
|
|
|
|
|
|
|
let _r = p.recv();
|
|
|
|
}
|
|
|
|
|
|
|
|
p.recv().send(test(42));
|
|
|
|
}
|