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) {
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue