On Mon, 4 Jul 2022 12:19:27 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> Ryan Ernst has updated the pull request incrementally with one additional >> commit since the last revision: >> >> better clarify multiple threads behavior > >> 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. > > If the hook threads do not halt then the exiting thread (which holds the > lock) blocks forever in the join(). Any other call to exit blocks trying to > acquire the lock. That has always been the way this works - if hook threads > don't terminate then the VM doesn't (unless someone calls halt() directly). > That is one of the things the window you suggested be closed, allowed - a > call to exit(non-zero) could force a call to halt(). I appreciate all the feedback and the many opinions expressed here! This has been a learning exercise for me in finding a balance between implementation and specification. While I still think mentioning the possibility of signals is beneficial to a developer trying to understand that the passed status code could be ignored, the text suggested by @dholmes-ora is better than was previously there, so I have updated this PR with that. See [fccd85b](https://github.com/openjdk/jdk/pull/9351/commits/fccd85ba106ff651c00479446ac3207ed60698e8). ------------- PR: https://git.openjdk.org/jdk/pull/9351