RFR: 8288984: Simplification in Shutdown.exit [v2]

Ryan Ernst duke at openjdk.org
Mon Jul 4 16:17:27 UTC 2022


On Mon, 4 Jul 2022 08:42:02 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> +1 - except for the "deadlock" part (see other comment).  I think the old paragraph is at least confusing, and perhaps even just wrong.  Let's say we've run `shutdown` so run all the hooks but not halted.  Then someone calls `exit(0)`.  That seems to suggest the call will block indefinitely, which is neither desirable nor what was actually implemented.
>
> David's refinement looks good.  The sentence on deadlock is accurate as shutdown hooks run on other threads, not the thread calling System.ext.

I reworded with the suggested text in mind. I also added another sentence referencing native signal handlers, which may also initiate shutdown. I think this clarification is important so that it is clear the status code of all invocations from Java may still be ignored. See [2253259](https://github.com/openjdk/jdk/pull/9351/commits/2253259c82b13e7b2186429a80cc42497235b035).

-------------

PR: https://git.openjdk.org/jdk/pull/9351


More information about the core-libs-dev mailing list