mirror of
https://github.com/corda/corda.git
synced 2025-06-22 00:57:21 +00:00
fix bug which caused Runtime.exec to block until process exits
This commit is contained in:
@ -65,8 +65,15 @@ public class Runtime {
|
|||||||
exec(command, info);
|
exec(command, info);
|
||||||
process[0] = new MyProcess
|
process[0] = new MyProcess
|
||||||
(info[0], (int) info[1], (int) info[2], (int) info[3]);
|
(info[0], (int) info[1], (int) info[2], (int) info[3]);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
exception[0] = e;
|
||||||
|
} finally {
|
||||||
|
process.notifyAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MyProcess p = process[0];
|
MyProcess p = process[0];
|
||||||
|
if (p != null) {
|
||||||
synchronized (p) {
|
synchronized (p) {
|
||||||
try {
|
try {
|
||||||
if (p.pid != 0) {
|
if (p.pid != 0) {
|
||||||
@ -77,11 +84,6 @@ public class Runtime {
|
|||||||
p.notifyAll();
|
p.notifyAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
|
||||||
exception[0] = e;
|
|
||||||
} finally {
|
|
||||||
process.notifyAll();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user