Skip to content

Commit d6c70b3

Browse files
committed
---
yaml --- r: 4561 b: refs/heads/master c: 832d89d h: refs/heads/master i: 4559: e1aed3c v: v3
1 parent 0a29e20 commit d6c70b3

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: ffd6ee0730f599de4765464f208d1c0cc3dcdfbc
2+
refs/heads/master: 832d89db4791b4487f739ecd6e10140da147a537

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
1-
// xfail-stage1
2-
// xfail-stage2
3-
// xfail-stage3
4-
51
// Create a task that is supervised by another task,
62
// join the supervised task from the supervising task,
73
// then fail the supervised task. The supervised task
84
// will kill the supervising task, waking it up. The
95
// supervising task no longer needs to be wakened when
106
// the supervised task exits.
117

8+
use std;
9+
import std::task;
10+
1211
fn supervised() {
1312
// Yield to make sure the supervisor joins before we
1413
// fail. This is currently not needed because the supervisor
1514
// runs first, but I can imagine that changing.
16-
yield;
15+
task::yield();
1716
fail;
1817
}
1918

2019
fn supervisor() {
21-
let task t = spawn "supervised" supervised();
22-
join t;
20+
// Unsupervise this task so the process doesn't return a failure status as
21+
// a result of the main task being killed.
22+
task::unsupervise();
23+
let t = spawn supervised();
24+
task::join(t);
2325
}
2426

2527
fn main() {
26-
// Start the test in another domain so that
27-
// the process doesn't return a failure status as a result
28-
// of the main task being killed.
29-
let task dom2 = spawn thread "supervisor" supervisor();
30-
join dom2;
28+
let dom2 = spawn supervisor();
29+
task::join(dom2);
3130
}
3231

3332
// Local Variables:

0 commit comments

Comments
 (0)