Skip to content

Commit 4831d7c

Browse files
committed
[FIX] Process writer thread lock
1 parent 0918276 commit 4831d7c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

library/src/main/java/ashell/workers/ShellOutputStreamThread.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ public ShellOutputStreamThread(Process process) {
4242

4343
@Override
4444
public void run() {
45-
while (true) {
46-
try {
47-
process.waitFor();
48-
} catch (InterruptedException e) {
49-
e.printStackTrace();
45+
synchronized (this) {
46+
while (true) {
47+
try {
48+
this.wait();
49+
} catch (InterruptedException e) {
50+
e.printStackTrace();
51+
}
5052
}
5153
}
5254
}

0 commit comments

Comments
 (0)