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:
parent
8dc69e1ca0
commit
c516d8d4ab
1 changed files with 5 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue