diff options
| author | bors <bors@rust-lang.org> | 2013-08-02 07:31:52 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-02 07:31:52 -0700 |
| commit | 986df44753a7dd2fe9077c6d537f02785cbaccc6 (patch) | |
| tree | 7e3ea157e53f302f5f46caea676b86a9ec7ece69 /src/libstd/rt/task.rs | |
| parent | af973397713806fdaf27b19e80637cc6a45d7278 (diff) | |
| parent | 963d37e821590b470f7a1fc9cfcda5a5ceceeee4 (diff) | |
| download | rust-986df44753a7dd2fe9077c6d537f02785cbaccc6.tar.gz rust-986df44753a7dd2fe9077c6d537f02785cbaccc6.zip | |
auto merge of #8195 : bblum/rust/task-cleanup, r=brson
In the first commit it is obvious why some of the barriers can be changed to ```Relaxed```, but it is not as obvious for the once I changed in ```kill.rs```. The rationale for those is documented as part of the documenting commit. Also the last commit is a temporary hack to prevent kill signals from being received in taskgroup cleanup code, which could be fixed in a more principled way once the old runtime is gone.
Diffstat (limited to 'src/libstd/rt/task.rs')
| -rw-r--r-- | src/libstd/rt/task.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 23a0d28e457..b242ee13fa6 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -212,8 +212,13 @@ impl Task { pub fn run(&mut self, f: &fn()) { rtdebug!("run called on task: %u", borrow::to_uint(self)); self.unwinder.try(f); - { let _ = self.taskgroup.take(); } - self.death.collect_failure(!self.unwinder.unwinding); + // 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(); } + self.death.collect_failure(!self.unwinder.unwinding, self.taskgroup.take()); self.destroy(); } |
