Use TerminateProcess in headless browsers
Exiting a process cleanly is difficult and expensive. Avoiding race conditions becomes almost impossible with complex software and a clean exit can be quite slow. Waiting on all threads, paging in code and data, and race conditions make it not worthwhile. We have been gradually moving towards using TerminateProcess for more process types. Although the majority of the shutdown processes tracked by this bug are in utility processes this change uses TerminateProcess for all process types. We should not need to let destructors run so it should be safe to never use exit() (or to make it opt-in). This change also adds TerminateProcess to windows_types.h to avoid having to add a Windows.h include to another source file. Bug: 896565 Change-Id: I720c692b3315544c09fe9ae438fb65f6f77fc657 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2598043Reviewed-by:Andrey Kosyakov <caseq@chromium.org> Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Cr-Commit-Position: refs/heads/master@{#838732}
Showing
Please register or sign in to comment