On Mon, 4 Jul 2022 08:42:02 GMT, Alan Bateman <al...@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

Reply via email to