[java] Waiting for process finish should be interruptible
@@ -161,6 +161,9 @@ public void waitFor(long timeout) throws InterruptedException {
long until = System.currentTimeMillis() + timeout;
boolean timedOut = true;
while (System.currentTimeMillis() < until) {
+ if (Thread.interrupted()) {
+ throw new InterruptedException();
+ }
if (handler.hasResult()) {
timedOut = false;
break;
