-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thread safety: lock around atexit_hooks global (#49868)
Ensure the lock is precise, so that we are allowed to register new atexit hooks from inside an atexit hook. But then disable `atexit()` when shutting down after it finishes running. Add tests that cover all the cases: 1. registering a hook from inside a hook 2. registering a hook from another thread while hooks are running 3. attempting to register a hook after all hooks have finished (disallowed) Fixes #49841 Co-authored-by: Jameson Nash <vtjnash@gmail.com>
- Loading branch information
Showing
2 changed files
with
129 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters