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