Subprocesses and Interruption
This pull request adresses to issues: Killing subprocesses and interrupting of a running process.
Subprocesses If a process spawns subprocesses, these processes are not destroyed in killProcessCleanup. Therefor are ProcessHandle is necessary.
** Interrupting ** A running process can be stopped if the corresponding thread is interrupted. If this happens, no exit code is available. If a java process is destroyed, the process returns exit code 1. Change: If the thread is interrupted, the process is killed/destroyed, but no exception is thrown. The control thread finishs normally and sets the exit code to 1 and dispatches the event "PROCESS_EXITED". The original thread finishs also normally without exception. In ProcBuilder the correct result will be created.
@ses1112 thank you for your contribution. These are interesting problems. As you have probably seen the documentation in README.md is generated from the acceptance test. It would be nice to document the two changes with a test case. Perhaps you can come up with them (ideally they would work on linux and macos)?
Potentially the killing of subprocesses should be configurable. What do you think?
Configurable sounds good, should this be a method in the ProcBuilder? And default false because of compatibility to older versions?
I can try to create a test for interrupting a running process, but for subprocess i don't know how i could make one.