mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-08 11:03:28 +02:00
Fix potential synchronization issue in Spawner
This commit is contained in:
parent
8dc69e1ca0
commit
c516d8d4ab
1 changed files with 5 additions and 3 deletions
|
@ -483,19 +483,21 @@ public class Spawner extends Process {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
int _pid;
|
||||||
try {
|
try {
|
||||||
pid = execute(fCmdarray, fEnvp, fDirpath, fChannels);
|
_pid = execute(fCmdarray, fEnvp, fDirpath, fChannels);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
pid = -1;
|
_pid = -1;
|
||||||
fException= e;
|
fException= e;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tell spawner that the process started.
|
// Tell spawner that the process started.
|
||||||
synchronized (Spawner.this) {
|
synchronized (Spawner.this) {
|
||||||
|
pid = _pid;
|
||||||
Spawner.this.notifyAll();
|
Spawner.this.notifyAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pid != -1) {
|
if (_pid != -1) {
|
||||||
// Sync with spawner and notify when done.
|
// Sync with spawner and notify when done.
|
||||||
status = waitFor(pid);
|
status = waitFor(pid);
|
||||||
synchronized (Spawner.this) {
|
synchronized (Spawner.this) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue