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 committed Mar 21, 2024
1 parent c8aa791 commit 207168d
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 207168d

Please sign in to comment.