Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-06-13 08:21:04 -0400
committerAndrey Loskutov2018-06-14 04:33:33 -0400
commit04c0b35dc76a6894ba060e486aae3e05d9fa867b (patch)
tree6ce30e527a76279cd563c99eae0ba126cdf49b42 /org.eclipse.debug.ui
parent5b6cb2ead8eff86a37754ccf26334e9d01b9a3d8 (diff)
downloadeclipse.platform.debug-04c0b35dc76a6894ba060e486aae3e05d9fa867b.tar.gz
eclipse.platform.debug-04c0b35dc76a6894ba060e486aae3e05d9fa867b.tar.xz
eclipse.platform.debug-04c0b35dc76a6894ba060e486aae3e05d9fa867b.zip
Bug 535686 - wait for pending ElementContentProvider jobs
Before triggering another update round via doModelChanged(), wait for all previously scheduled ElementContentProvider jobs, so that they can read the model data before it changes again. Change-Id: I2534d140c295341f3a69793254b6f94d5e7ef04e Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
index 0aae6460b..e6b5e82d9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
@@ -27,10 +27,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
@@ -451,7 +453,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
DebugUIPlugin.trace("Delayed queue size: " + fQueue.size()); //$NON-NLS-1$
}
}
- schedule(50);
+ schedule();
}
public void shutdown() {
@@ -488,6 +490,11 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
doModelChanged(delta, proxy);
}
else {
+ try {
+ Job.getJobManager().join(ElementContentProvider.class, null);
+ } catch (OperationCanceledException | InterruptedException e) {
+ DebugUIPlugin.log(new Status(IStatus.WARNING, DebugUIPlugin.getUniqueIdentifier(), "Interrupted while waiting on ElementContentProvider jobs", e)); //$NON-NLS-1$
+ }
fDelayedDoModelChangeJob.runDelayed(delta, proxy);
}
}

Back to the top