Skip to content

Commit 3b29fbd

Browse files
committed
---
yaml --- r: 64955 b: refs/heads/snap-stage3 c: 963d37e h: refs/heads/master i: 64953: f261300 64951: 62f4fe8 v: v3
1 parent 7773c80 commit 3b29fbd

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: aeaed77301397c6ab0c4f5413dbd4b7f0d5b5c9a
4+
refs/heads/snap-stage3: 963d37e821590b470f7a1fc9cfcda5a5ceceeee4
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/rt/kill.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ use either::{Either, Left, Right};
7272
use option::{Option, Some, None};
7373
use prelude::*;
7474
use rt::task::Task;
75+
use task::spawn::Taskgroup;
7576
use to_bytes::IterBytes;
7677
use unstable::atomics::{AtomicUint, Relaxed};
7778
use unstable::sync::{UnsafeAtomicRcBox, LittleLock};
@@ -474,7 +475,7 @@ impl Death {
474475
}
475476

476477
/// Collect failure exit codes from children and propagate them to a parent.
477-
pub fn collect_failure(&mut self, mut success: bool) {
478+
pub fn collect_failure(&mut self, mut success: bool, group: Option<Taskgroup>) {
478479
// This may run after the task has already failed, so even though the
479480
// task appears to need to be killed, the scheduler should not fail us
480481
// when we block to unwrap.
@@ -484,6 +485,10 @@ impl Death {
484485
rtassert!(self.unkillable == 0);
485486
self.unkillable = 1;
486487

488+
// FIXME(#7544): See corresponding fixme at the callsite in task.rs.
489+
// NB(#8192): Doesn't work with "let _ = ..."
490+
{ use util; util::ignore(group); }
491+
487492
// Step 1. Decide if we need to collect child failures synchronously.
488493
do self.on_exit.take_map |on_exit| {
489494
if success {

branches/snap-stage3/src/libstd/rt/task.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,13 @@ impl Task {
129129
}
130130

131131
self.unwinder.try(f);
132-
{ let _ = self.taskgroup.take(); }
133-
self.death.collect_failure(!self.unwinder.unwinding);
132+
// FIXME(#7544): We pass the taskgroup into death so that it can be
133+
// dropped while the unkillable counter is set. This should not be
134+
// necessary except for an extraneous clone() in task/spawn.rs that
135+
// causes a killhandle to get dropped, which mustn't receive a kill
136+
// signal since we're outside of the unwinder's try() scope.
137+
// { let _ = self.taskgroup.take(); }
138+
self.death.collect_failure(!self.unwinder.unwinding, self.taskgroup.take());
134139
self.destroy();
135140
}
136141

0 commit comments

Comments
 (0)