Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-08-22 18:12:48 -0400
committerSergey Prigogin2012-08-22 19:58:28 -0400
commit2be9f2606978ba39668292318da23f3985cb608b (patch)
tree3954247ab7794027e6e12746e2decfbe524d21e8
parent822e2091d207091b00c8cf17af1d6f6a3fb1304d (diff)
downloadorg.eclipse.cdt-2be9f2606978ba39668292318da23f3985cb608b.tar.gz
org.eclipse.cdt-2be9f2606978ba39668292318da23f3985cb608b.tar.xz
org.eclipse.cdt-2be9f2606978ba39668292318da23f3985cb608b.zip
Added synchronization on fTaskQueue to PDOMManager.isIndexerIdle()
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
index 609d2d334b..13dbeb3826 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
@@ -720,7 +720,9 @@ public class PDOMManager implements IWritableIndexManager, IListener {
@Override
public boolean isIndexerIdle() {
- return Job.getJobManager().find(this).length == 0;
+ synchronized (fTaskQueue) {
+ return Job.getJobManager().find(this).length == 0;
+ }
}
void addProject(final ICProject cproject) {
@@ -1097,7 +1099,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
@Override
public void done(IJobChangeEvent event) {
synchronized (idleCondition) {
- if (Job.getJobManager().find(PDOMManager.this).length == 0) {
+ if (isIndexerIdle()) {
idleCondition[0] = true;
idleCondition.notifyAll();
}
@@ -1106,7 +1108,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
};
Job.getJobManager().addJobChangeListener(listener);
try {
- if (Job.getJobManager().find(this).length == 0) {
+ if (isIndexerIdle()) {
return true;
}
synchronized (idleCondition) {

Back to the top