2011-08-05 20:43:33 -05:00
|
|
|
use std;
|
|
|
|
|
|
|
|
import std::comm;
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn main() { test05(); }
|
2010-07-19 16:05:18 -05:00
|
|
|
|
2011-08-05 20:43:33 -05:00
|
|
|
fn test05_start(pch: *u8) {
|
|
|
|
let ch = comm::chan_from_unsafe_ptr(pch);
|
|
|
|
|
|
|
|
ch.send(10);
|
|
|
|
ch.send(20);
|
|
|
|
ch.send(30);
|
|
|
|
}
|
2010-07-19 16:05:18 -05:00
|
|
|
|
2011-04-19 15:35:49 -05:00
|
|
|
fn test05() {
|
2011-08-05 20:43:33 -05:00
|
|
|
let po = comm::mk_port[int]();
|
|
|
|
let ch = po.mk_chan();
|
|
|
|
spawn test05_start(ch.unsafe_ptr());
|
|
|
|
let value = po.recv();
|
|
|
|
value = po.recv();
|
|
|
|
value = po.recv();
|
2011-05-02 19:47:24 -05:00
|
|
|
assert (value == 30);
|
2011-07-27 07:19:39 -05:00
|
|
|
}
|