Skip to content

Commit 1915638

Browse files
Synchronize ShellExec doProcess to prevent race condition on gobblers
1 parent 14d0596 commit 1915638

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

photon-core/src/main/java/org/photonvision/common/util/ShellExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public int execute(String command, String workdir, boolean wait, String... args)
136136
return doProcess(wait, process);
137137
}
138138

139-
private int doProcess(boolean wait, Process process) {
139+
private synchronized int doProcess(boolean wait, Process process) {
140140
errorGobbler = new StreamGobbler(process.getErrorStream(), readError);
141141
outputGobbler = new StreamGobbler(process.getInputStream(), readOutput);
142142
errorGobbler.start();

0 commit comments

Comments
 (0)