1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Fix potential synchronization issue in Spawner

This commit is contained in:
Anton Leherbauer 2014-02-04 16:55:57 +01:00
parent 8dc69e1ca0
commit c516d8d4ab

View file

@ -483,19 +483,21 @@ public class Spawner extends Process {
@Override
public void run() {
int _pid;
try {
pid = execute(fCmdarray, fEnvp, fDirpath, fChannels);
_pid = execute(fCmdarray, fEnvp, fDirpath, fChannels);
} catch (Exception e) {
pid = -1;
_pid = -1;
fException= e;
}
// Tell spawner that the process started.
synchronized (Spawner.this) {
pid = _pid;
Spawner.this.notifyAll();
}
if (pid != -1) {
if (_pid != -1) {
// Sync with spawner and notify when done.
status = waitFor(pid);
synchronized (Spawner.this) {