Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2014-02-04 15:55:57 +0000
committerAnton Leherbauer2014-02-04 15:57:05 +0000
commitfd647bfd0d4b04238271930431818deb3ef2ad49 (patch)
tree645d2f5cef3fd9d83159a590fc43e8e94cd4494f
parentc3733d0473c9504467759f300f264fb4c0936dea (diff)
downloadorg.eclipse.cdt-fd647bfd0d4b04238271930431818deb3ef2ad49.tar.gz
org.eclipse.cdt-fd647bfd0d4b04238271930431818deb3ef2ad49.tar.xz
org.eclipse.cdt-fd647bfd0d4b04238271930431818deb3ef2ad49.zip
Fix potential synchronization issue in Spawner
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java
index c8f66f41118..c003698ebf9 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java
@@ -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) {

Back to the top