You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Lock the atexit_hooks during execution of the hooks on shutdown.
FixesJuliaLang#49841.
Follow-up to JuliaLang#49774.
This PR makes two changes:
1. It locks `atexit_hooks` while iterating the hooks during execution of `_atexit()` at shutdown.
- This prevents any data races if another Task is registering a new atexit hook while the hooks are being evaluated.
2. It defines semantics for what happens if another Task attempts to register another atexit hook _after all the hooks have finished_, and we've proceeded on to the rest of shutdown.
- Previously, those atexit hooks would be _ignored,_ which violates the user's expectations and violates the "atexit" contract.
- Now, the attempt to register the atexit hook will **throw an exception,** which ensures that we never break our promise, since the user was never able to register the atexit hook at all.
- This does mean that users will need to handle the thrown exception and likely do now whatever tear down they were hoping to delay until exit.
* Fix merge conflict
0 commit comments