diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-11-06 02:26:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-06 02:26:39 -0500 |
commit | e217672c1ab665a68aca36bb5086956254604e75 (patch) | |
tree | ba17a4b93d48fd4d838a3ef930a2da8acd09929e /components/script/dom/nodeiterator.rs | |
parent | e265fcfc3ca55b1a23ee7d1ad24f8f334187be11 (diff) | |
parent | 27186751913beb7b81220404ea4cf58fac6f2d0d (diff) | |
download | servo-e217672c1ab665a68aca36bb5086956254604e75.tar.gz servo-e217672c1ab665a68aca36bb5086956254604e75.zip |
Auto merge of #22092 - paulrouget:thread_count, r=manishearth
Count threads at shutdown, warn if not all finished and optionally block
On Desktop, after servo shutdown, the process exits, killing all the still-running threads.
On mobile, the process doesn't necessarily shutdown, and we are left with multiple threads failing to use channels, printing warning and panicking.
In the future, we'd like to do a clean shutdown, as in, shutdown only once all the threads have properly finished.
For now, I'm printing a warning if all the threads are not finished, and also add an option to only exit if all the threads have finished.
This only works on MacOS for now, in C, as I haven't found a Rust/multiplatform way to count running threads.
I recommend trying to run servo with `--clean-shutdown` option. Interesting to see how long it takes for other threads to shutdown, and see which threads start panicking.
---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22092)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/nodeiterator.rs')
0 files changed, 0 insertions, 0 deletions