diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java index d6e41de321f..076b6bd8ed8 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java @@ -776,17 +776,17 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang synchronized (binaryRunners) { runner = binaryRunners.get(project); } - // creation of BinaryRunner must occur outside the synchronized block if (runner == null) { + // creation of BinaryRunner must occur outside the synchronized block runner = new BinaryRunner(project); - } - synchronized (binaryRunners) { - if (binaryRunners.get(project) == null) { - binaryRunners.put(project, runner); - runner.start(); - } else { - // another thread was faster - runner = binaryRunners.get(project); + synchronized (binaryRunners) { + if (binaryRunners.get(project) == null) { + binaryRunners.put(project, runner); + runner.start(); + } else { + // another thread was faster + runner = binaryRunners.get(project); + } } } return runner;