1
Fork 0
rust/src/test/run-pass/task-comm-11.rs

29 lines
749 B
Rust
Raw Normal View History

// Copyright 2012-2014 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.
// ignore-fast
extern crate extra;
use std::task;
2013-12-05 18:19:06 -08:00
fn start(c: &Chan<Chan<int>>) {
let (_p, ch) = Chan::new();
2013-02-15 02:44:18 -08:00
c.send(ch);
}
2010-08-11 15:05:33 -07:00
pub fn main() {
2013-12-05 18:19:06 -08:00
let (mut p, ch) = Chan::new();
let _child = task::spawn(proc() {
start(&ch)
});
2013-08-17 08:37:42 -07:00
let _c = p.recv();
}