RFR: 8288984: Simplification in Shutdown.exit [v3]
Ryan Ernst
duke at openjdk.org
Tue Jul 5 03:27:29 UTC 2022
On Tue, 5 Jul 2022 00:16:50 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Ryan Ernst has updated the pull request incrementally with one additional commit since the last revision:
>>
>> iterate on wording
>
> src/java.base/share/classes/java/lang/Runtime.java line 88:
>
>> 86: * <p> Shutdown is serialized such that only one invocation will run
>> 87: * shutdown hooks and terminate the VM with the given status code. That
>> 88: * invocation may be initiated via platform specific signal handlers. All
>
> Why are we mentioning signal handlers here? How is that relevant?
Signal handlers for eg SIGTERM invoke Shutdown.shutdown. That method holds the same lock as Shutdown.exit and runs shutdown hooks. So if a signal handler triggers shutdown, and before the system halts Runtime.exit is invoked, the status passed to Runtime.exit will be ignored.
-------------
PR: https://git.openjdk.org/jdk/pull/9351
More information about the core-libs-dev
mailing list