2011-09-09 15:25:06 -05:00
|
|
|
// xfail-win32
|
2011-09-07 19:01:24 -05:00
|
|
|
use std;
|
2011-12-13 18:25:51 -06:00
|
|
|
import task;
|
|
|
|
import comm;
|
2011-09-07 19:01:24 -05:00
|
|
|
|
2012-06-01 16:48:02 -05:00
|
|
|
class complainer {
|
|
|
|
let c: comm::chan<bool>;
|
|
|
|
new(c: comm::chan<bool>) {
|
|
|
|
#error("Hello!");
|
|
|
|
self.c = c; }
|
|
|
|
drop { #error("About to send!");
|
|
|
|
comm::send(self.c, true);
|
|
|
|
#error("Sent!"); }
|
2011-09-07 19:01:24 -05:00
|
|
|
}
|
|
|
|
|
2011-10-20 22:34:04 -05:00
|
|
|
fn f(c: comm::chan<bool>) {
|
2012-06-01 16:48:02 -05:00
|
|
|
let _c <- complainer(c);
|
2011-09-07 19:01:24 -05:00
|
|
|
fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let p = comm::port();
|
|
|
|
let c = comm::chan(p);
|
2012-04-05 16:09:32 -05:00
|
|
|
let builder = task::builder();
|
2012-02-18 18:34:42 -06:00
|
|
|
task::unsupervise(builder);
|
2012-06-30 18:19:07 -05:00
|
|
|
task::run(builder, || f(c) );
|
2012-06-01 16:48:02 -05:00
|
|
|
#error("hiiiiiiiii");
|
2011-09-07 19:01:24 -05:00
|
|
|
assert comm::recv(p);
|
|
|
|
}
|