Skip to content

Commit

Permalink
Clean up transitionary glue in task/spawn.rs. Don't hold kill-little-…
Browse files Browse the repository at this point in the history
…lock for O(n) time, cf #3100, and optimize out several unneeded clone()s.
  • Loading branch information
bblum committed Aug 12, 2013
1 parent ce48e71 commit 5ac8c57
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 138 deletions.
4 changes: 2 additions & 2 deletions src/libstd/rt/kill.rs
Expand Up @@ -488,8 +488,8 @@ impl Death {
rtassert!(self.unkillable == 0);
self.unkillable = 1;

// FIXME(#7544): See corresponding fixme at the callsite in task.rs.
// NB(#8192): Doesn't work with "let _ = ..."
// NB. See corresponding comment at the callsite in task.rs.
// FIXME(#8192): Doesn't work with "let _ = ..."
{ use util; util::ignore(group); }

// Step 1. Decide if we need to collect child failures synchronously.
Expand Down
10 changes: 4 additions & 6 deletions src/libstd/rt/task.rs
Expand Up @@ -253,12 +253,10 @@ impl Task {
}
}

// FIXME(#7544): We pass the taskgroup into death so that it can be
// dropped while the unkillable counter is set. This should not be
// necessary except for an extraneous clone() in task/spawn.rs that
// causes a killhandle to get dropped, which mustn't receive a kill
// signal since we're outside of the unwinder's try() scope.
// { let _ = self.taskgroup.take(); }
// NB. We pass the taskgroup into death so that it can be dropped while
// the unkillable counter is set. This is necessary for when the
// taskgroup destruction code drops references on KillHandles, which
// might require using unkillable (to synchronize with an unwrapper).
self.death.collect_failure(!self.unwinder.unwinding, self.taskgroup.take());
self.destroyed = true;
}
Expand Down
1 change: 0 additions & 1 deletion src/libstd/task/mod.rs
Expand Up @@ -38,7 +38,6 @@
use prelude::*;

use cell::Cell;
use cmp::Eq;
use comm::{stream, Chan, GenericChan, GenericPort, Port};
use result::Result;
use result;
Expand Down

5 comments on commit 5ac8c57

@bors
Copy link
Contributor

@bors bors commented on 5ac8c57 Aug 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at bblum@5ac8c57

@bors
Copy link
Contributor

@bors bors commented on 5ac8c57 Aug 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging bblum/rust/assorted-fixes = 5ac8c57 into auto

@bors
Copy link
Contributor

@bors bors commented on 5ac8c57 Aug 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bblum/rust/assorted-fixes = 5ac8c57 merged ok, testing candidate = f02cc6b

@bors
Copy link
Contributor

@bors bors commented on 5ac8c57 Aug 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = f02cc6b

Please sign in to comment.