Skip to content

Commit 07bb1ae

Browse files
committed
task.rs rename supervise to linked internally
1 parent bb2c45f commit 07bb1ae

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/libcore/task.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ type sched_opts = {
146146
*
147147
* # Fields
148148
*
149-
* * supervise - Do not propagate failure to the parent task
149+
* * linked - Do not propagate failure to the parent task
150150
*
151151
* All tasks are linked together via a tree, from parents to children. By
152152
* default children are 'supervised' by their parent and when they fail
@@ -169,7 +169,7 @@ type sched_opts = {
169169
* scheduler other tasks will be impeded or even blocked indefinitely.
170170
*/
171171
type task_opts = {
172-
supervise: bool,
172+
linked: bool,
173173
parented: bool,
174174
notify_chan: option<comm::chan<notification>>,
175175
sched: option<sched_opts>,
@@ -207,7 +207,7 @@ fn default_task_opts() -> task_opts {
207207
*/
208208

209209
{
210-
supervise: true,
210+
linked: true,
211211
parented: false,
212212
notify_chan: none,
213213
sched: none
@@ -239,7 +239,7 @@ fn set_opts(builder: builder, opts: task_opts) {
239239
* To update a single option use a pattern like the following:
240240
*
241241
* set_opts(builder, {
242-
* supervise: false
242+
* linked: false
243243
* with get_opts(builder)
244244
* });
245245
*/
@@ -360,7 +360,7 @@ fn unsupervise(builder: builder) {
360360
//! Configures the new task to not propagate failure to its parent
361361
362362
set_opts(builder, {
363-
supervise: false
363+
linked: false
364364
with get_opts(builder)
365365
});
366366
}
@@ -745,15 +745,15 @@ fn share_parent_taskgroup() -> (taskgroup_arc, bool) {
745745

746746
fn spawn_raw(opts: task_opts, +f: fn~()) {
747747
// Decide whether the child needs to be in a new linked failure group.
748-
let ((child_tg, is_main), parent_tg) = if opts.supervise {
748+
let ((child_tg, is_main), parent_tg) = if opts.linked {
749749
// It doesn't mean anything for a linked-spawned-task to have a parent
750750
// group. The spawning task is already bidirectionally linked to it.
751751
(share_parent_taskgroup(), none)
752752
} else {
753753
// Detached from the parent group; create a new (non-main) one.
754754
((arc::exclusive(some((dvec::dvec(),dvec::dvec()))), false),
755755
// Allow the parent to unidirectionally fail the child?
756-
if opts.parented { // FIXME(#1868) rename to unsupervise.
756+
if opts.parented {
757757
let (pg,_) = share_parent_taskgroup(); some(pg)
758758
} else {
759759
none
@@ -1145,7 +1145,7 @@ fn test_spawn_raw_simple() {
11451145
#[ignore(cfg(windows))]
11461146
fn test_spawn_raw_unsupervise() {
11471147
let opts = {
1148-
supervise: false
1148+
linked: false
11491149
with default_task_opts()
11501150
};
11511151
do spawn_raw(opts) {
@@ -1269,7 +1269,7 @@ fn test_spawn_raw_notify() {
12691269
assert comm::recv(notify_po) == exit(task_, success);
12701270

12711271
let opts = {
1272-
supervise: false,
1272+
linked: false,
12731273
notify_chan: some(notify_ch)
12741274
with default_task_opts()
12751275
};
@@ -1592,7 +1592,7 @@ fn test_unkillable() {
15921592
let ch = po.chan();
15931593
15941594
// We want to do this after failing
1595-
do spawn_raw({ supervise: false with default_task_opts() }) {
1595+
do spawn_raw({ linked: false with default_task_opts() }) {
15961596
for iter::repeat(10u) { yield() }
15971597
ch.send(());
15981598
}
@@ -1629,7 +1629,7 @@ fn test_unkillable_nested() {
16291629
let ch = po.chan();
16301630
16311631
// We want to do this after failing
1632-
do spawn_raw({ supervise: false with default_task_opts() }) {
1632+
do spawn_raw({ linked: false with default_task_opts() }) {
16331633
for iter::repeat(10u) { yield() }
16341634
ch.send(());
16351635
}

0 commit comments

Comments
 (0)