2011-09-14 17:26:59 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
// error-pattern:1 == 2
|
2011-10-03 16:46:52 -05:00
|
|
|
// xfail-test Been deadlocking on mac
|
2011-09-14 17:26:59 -05:00
|
|
|
use std;
|
|
|
|
import std::task;
|
|
|
|
import std::comm::chan;
|
|
|
|
import std::comm::port;
|
|
|
|
import std::comm::recv;
|
|
|
|
|
|
|
|
fn child() { assert (1 == 2); }
|
|
|
|
|
|
|
|
fn parent() {
|
|
|
|
let p = port::<int>();
|
|
|
|
let f = child;
|
|
|
|
task::spawn(f);
|
|
|
|
let x = recv(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This task is not linked to the failure chain, but since the other
|
|
|
|
// tasks are going to fail the kernel, this one will fail too
|
|
|
|
fn sleeper() {
|
|
|
|
let p = port::<int>();
|
|
|
|
let x = recv(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let g = sleeper;
|
|
|
|
task::spawn(g);
|
2011-09-14 19:05:35 -05:00
|
|
|
let f = parent;
|
|
|
|
task::spawn(f);
|
2011-09-14 17:26:59 -05:00
|
|
|
}
|