Skip to content

Commit

Permalink
Enable proper termination of ProcessServer.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianKroiss authored and fabioz committed May 4, 2024
1 parent 91f03d3 commit aab88a3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ProcessServer extends Process {
private PipedInputStream errorStream;
private OutputStream outputStream;
private Object lock;
private boolean exited = false;

public ProcessServer() {
super();
Expand Down Expand Up @@ -73,6 +74,9 @@ public int waitFor() throws InterruptedException {

@Override
public int exitValue() {
if (exited) {
return 0;
}
throw new IllegalThreadStateException();
}

Expand Down Expand Up @@ -111,6 +115,8 @@ public void destroy() {
} catch (Exception e) {
Log.log(e);
}

exited = true;
}

/**
Expand Down

0 comments on commit aab88a3

Please sign in to comment.