2013-06-27 16:53:40 -07:00
|
|
|
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2014-01-09 21:06:55 +11:00
|
|
|
use std::io::println;
|
|
|
|
|
2013-09-25 00:43:37 -07:00
|
|
|
pub fn main() {
|
2013-12-05 18:19:06 -08:00
|
|
|
let (port, chan) = Chan::new();
|
2013-06-27 16:53:40 -07:00
|
|
|
|
2014-01-27 18:29:50 -05:00
|
|
|
spawn(proc() {
|
2013-07-31 23:12:20 -07:00
|
|
|
println(port.recv());
|
2014-01-27 18:29:50 -05:00
|
|
|
});
|
2013-06-27 16:53:40 -07:00
|
|
|
|
|
|
|
chan.send("hello, world");
|
|
|
|
}
|