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:
parent
adde620eaf
commit
b037cb4811
1 changed files with 9 additions and 9 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue