On Mon, 10 Jun 2024 13:48:08 GMT, Roger Riggs <rri...@openjdk.org> wrote:

>> I don't have a test or counter example and don't have a detailed 
>> understanding of the blocking needs of Hotspot.
>
> Another reason to retain the checking of GetThreadInterruptEvent is to be 
> belt and suspenders against the Java code changing and opening up a potential 
> error. At the moment, the reaper thread is encapsulated and not likely to get 
> an interrupt, but that might not always be the case and someone changing the 
> Java code might be unaware of the native code details.  $.02

I did some research, and now I'm pretty confident that WaitForSingleObject is 
the right option:
- the thread involved here is a daemon thread, i.e. it doesn't prevent JVM exit
- the Unix version of `waitForProcessExit0` ignores interrupts and signals, it 
only ends when the wait succeeds or fails
- I didn't observe any problems with exiting the JVM while waiting on a process 
handle
- it's not clear to me what action we would take if the thread was cancelled; 
completing a CompletableFuture with an InterruptedException doesn't feel right.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19586#discussion_r1633522031

Reply via email to