Skip to content

Commit b2dd5f5

Browse files
committed
Rehabilitate run-pass/task-killjoin.rs
1 parent a6f9f73 commit b2dd5f5

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// xfail-test
2-
1+
// xfail-win32
32
// Create a task that is supervised by another task,
43
// join the supervised task from the supervising task,
54
// then fail the supervised task. The supervised task
@@ -10,27 +9,26 @@
109
use std;
1110
import std::task;
1211

13-
fn supervised() {
12+
fn supervised(&&_args: ()) {
1413
// Yield to make sure the supervisor joins before we
1514
// fail. This is currently not needed because the supervisor
1615
// runs first, but I can imagine that changing.
1716
task::yield();
1817
fail;
1918
}
2019

21-
fn supervisor() {
20+
fn supervisor(&&_args: ()) {
2221
// Unsupervise this task so the process doesn't return a failure status as
2322
// a result of the main task being killed.
2423
task::unsupervise();
2524
let f = supervised;
26-
let t = task::_spawn(supervised);
27-
task::join_id(t);
25+
let t = task::spawn_joinable((), supervised);
26+
task::join(t);
2827
}
2928

3029
fn main() {
31-
let f = supervisor;
32-
let dom2 = task::_spawn(f);
33-
task::join_id(dom2);
30+
let dom2 = task::spawn_joinable((), supervisor);
31+
task::join(dom2);
3432
}
3533

3634
// Local Variables:

0 commit comments

Comments
 (0)