Skip to content

Commit 81f1081

Browse files
committed
Fix and un-xfail task-killjoin-rsrc.rs
1 parent d0fb853 commit 81f1081

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/test/run-pass/task-killjoin-rsrc.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// xfail-test
2-
31
// A port of task-killjoin to use a class with a dtor to manage
42
// the join.
53

@@ -10,7 +8,7 @@ class notify {
108
let ch: comm::chan<bool>; let v: @mut bool;
119
new(ch: comm::chan<bool>, v: @mut bool) { self.ch = ch; self.v = v; }
1210
drop {
13-
#error~["notify: task=%? v=%x unwinding=%b b=%b",
11+
#error["notify: task=%? v=%x unwinding=%b b=%b",
1412
task::get_task(),
1513
ptr::addr_of(*(self.v)) as uint,
1614
task::failing(),
@@ -20,11 +18,10 @@ class notify {
2018
}
2119
}
2220
23-
fn joinable(f: fn~()) -> comm::port<bool> {
24-
fn wrapper(+pair: (comm::chan<bool>, fn())) {
25-
let (c, f) = pair;
21+
fn joinable(+f: fn~()) -> comm::port<bool> {
22+
fn wrapper(+c: comm::chan<bool>, +f: fn()) {
2623
let b = @mut false;
27-
#error~["wrapper: task=%? allocated v=%x",
24+
#error["wrapper: task=%? allocated v=%x",
2825
task::get_task(),
2926
ptr::addr_of(*b) as uint];
3027
let _r = notify(c, b);
@@ -33,7 +30,7 @@ fn joinable(f: fn~()) -> comm::port<bool> {
3330
}
3431
let p = comm::port();
3532
let c = comm::chan(p);
36-
let _ = task::spawn_unlinked {|| wrapper((c, f)) };
33+
do task::spawn_unlinked { wrapper(c, copy f) };
3734
p
3835
}
3936

@@ -57,7 +54,7 @@ fn supervisor() {
5754
}
5855

5956
fn main() {
60-
join(joinable({|| supervisor()}));
57+
join(joinable(supervisor));
6158
}
6259

6360
// Local Variables:

0 commit comments

Comments
 (0)