2012-12-10 19:32:48 -06:00
|
|
|
// Copyright 2012 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.
|
|
|
|
|
2012-08-10 20:35:41 -05:00
|
|
|
// xfail-fast
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2012-12-11 14:26:41 -06:00
|
|
|
let (p,c) = pipes::stream();
|
2013-02-15 04:44:18 -06:00
|
|
|
do task::try || {
|
2012-12-11 14:26:41 -06:00
|
|
|
let (p2,c2) = pipes::stream();
|
2013-02-15 04:44:18 -06:00
|
|
|
do task::spawn || {
|
2012-08-10 18:17:53 -05:00
|
|
|
p2.recv();
|
2012-09-19 00:45:24 -05:00
|
|
|
error!("sibling fails");
|
2013-02-11 21:26:38 -06:00
|
|
|
fail!();
|
2012-08-10 18:17:53 -05:00
|
|
|
}
|
2012-12-11 14:26:41 -06:00
|
|
|
let (p3,c3) = pipes::stream();
|
2013-02-15 04:44:18 -06:00
|
|
|
c.send(c3);
|
2012-08-10 18:17:53 -05:00
|
|
|
c2.send(());
|
2012-10-12 14:32:36 -05:00
|
|
|
error!("child blocks");
|
2012-08-10 18:17:53 -05:00
|
|
|
p3.recv();
|
|
|
|
};
|
2012-10-12 14:32:36 -05:00
|
|
|
error!("parent tries");
|
2012-08-10 18:17:53 -05:00
|
|
|
assert !p.recv().try_send(());
|
2012-10-12 14:32:36 -05:00
|
|
|
error!("all done!");
|
2012-08-10 18:17:53 -05:00
|
|
|
}
|