Auto merge of #11497 - ab22:11467-resource-threads-race-with-shutdown-to-write-out-data, r=Ms2ger

send a reply when thread is done exiting

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #11467

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because: in this case if code compiles then it's good enough.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11497)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-06-01 06:46:58 -05:00
commit 351b851e21
6 changed files with 33 additions and 11 deletions

View file

@ -211,7 +211,7 @@ impl ResourceChannelManager {
CoreResourceMsg::Synchronize(sender) => {
let _ = sender.send(());
}
CoreResourceMsg::Exit => {
CoreResourceMsg::Exit(sender) => {
if let Some(ref config_dir) = opts::get().config_dir {
match self.resource_manager.auth_cache.read() {
Ok(auth_cache) => write_json_to_file(&*auth_cache, config_dir, "auth_cache.json"),
@ -226,6 +226,7 @@ impl ResourceChannelManager {
Err(_) => warn!("Error writing hsts list to disk"),
}
}
let _ = sender.send(());
break;
}