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