Skip to content

Commit

Permalink
[Truffle] Properly handle interruptible process.waitFor() during Kern…
Browse files Browse the repository at this point in the history
…el#`
  • Loading branch information
chrisseaton committed Nov 1, 2016
1 parent 85408f4 commit 6c0ee33
Showing 1 changed file with 1 addition and 10 deletions.
Expand Up @@ -263,16 +263,7 @@ private ExecuteResult spawnAndCaptureOutput(DynamicObject command, final Dynamic
throw new JavaException(e);
}

int code;

while (true) {
try {
code = process.waitFor();
break;
} catch (InterruptedException e) {
continue;
}
}
final int code = getContext().getThreadManager().runUntilResult(this, () -> process.waitFor());

// TODO (nirvdrum 10-Mar-15) This should be using the default external encoding, rather than hard-coded to UTF-8.
final DynamicObject output = createString(baos.toByteArray(), EncodingOperations.getEncoding(getContext().getEncodingManager().getRubyEncoding("UTF-8")));
Expand Down

0 comments on commit 6c0ee33

Please sign in to comment.