Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 49868 #20

Merged
merged 2 commits into from
Jul 21, 2023
Merged

Backport 49868 #20

merged 2 commits into from
Jul 21, 2023

Commits on Jul 19, 2023

  1. Lock the atexit_hooks during execution of the hooks on shutdown.

    Fixes JuliaLang#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.
    NHDaly committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    54ae3b6 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. Fix merge conflict

    NHDaly authored Jul 20, 2023
    Configuration menu
    Copy the full SHA
    4417fb8 View commit details
    Browse the repository at this point in the history