1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 301229 - Don't create BinaryRunner inside synchronized block (reworked)

This commit is contained in:
Anton Leherbauer 2010-02-20 10:51:38 +00:00
parent adde620eaf
commit b037cb4811

View file

@ -776,17 +776,17 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
synchronized (binaryRunners) { synchronized (binaryRunners) {
runner = binaryRunners.get(project); runner = binaryRunners.get(project);
} }
// creation of BinaryRunner must occur outside the synchronized block
if (runner == null) { if (runner == null) {
// creation of BinaryRunner must occur outside the synchronized block
runner = new BinaryRunner(project); runner = new BinaryRunner(project);
} synchronized (binaryRunners) {
synchronized (binaryRunners) { if (binaryRunners.get(project) == null) {
if (binaryRunners.get(project) == null) { binaryRunners.put(project, runner);
binaryRunners.put(project, runner); runner.start();
runner.start(); } else {
} else { // another thread was faster
// another thread was faster runner = binaryRunners.get(project);
runner = binaryRunners.get(project); }
} }
} }
return runner; return runner;