On Thu, 10 Nov 2022 12:33:05 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
> One final question - Now with this change, `Process.waitFor()` won't throw > the `IllegalThreadStateException` for such programs that return > `STILL_ACTIVE` exit code. However, looking at the code a subsequent > Process.exitValue() call on that same process instance will still throw this > exception. Should we be changing that too? To fix that we'd have to find another Windows API to determine if the process had exited. >From the Windows API description, `GetExitCodeProcess` seems to be the >recommended way. Also if `exitValue()` returned `STILL_ACTIVE` it would still be confusing to the program/programmer about whether the process had exited and where that exitValue came from. I think the current Windows admonition about returning STILL_ACTIVE to "don't do that" is sufficient. ------------- PR: https://git.openjdk.org/jdk/pull/10680