diff options
author | Patrick Tasse | 2018-11-23 16:18:47 +0000 |
---|---|---|
committer | Patrick Tasse | 2018-12-04 18:54:34 +0000 |
commit | db6af8f53c190c584687bf60f451da4be89b6681 (patch) | |
tree | 30991304ee83e24c9122a6cf8a8542a6514ba482 | |
parent | 9f7fe034665ee40282a47448082aa32cf325f66a (diff) | |
download | org.eclipse.tracecompass-db6af8f53c190c584687bf60f451da4be89b6681.tar.gz org.eclipse.tracecompass-db6af8f53c190c584687bf60f451da4be89b6681.tar.xz org.eclipse.tracecompass-db6af8f53c190c584687bf60f451da4be89b6681.zip |
tmf: Fix API breakage in AbstractTimeGraphView
Change-Id: I36f9ae7dc9217432b4eefb7d44187617860dbe15
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/132995
Tested-by: CI Bot
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r-- | tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java index 4657657f9c..522efa74d1 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java @@ -550,18 +550,18 @@ public abstract class AbstractTimeGraphView extends TmfView implements ITmfTimeA } /** - * Applies the results of the ZoomThread calculations on the UI thread. + * Applies the results of the ZoomThread calculations asynchronously on + * the UI thread. * <p> * Note: This method makes sure that only the results of the last * created ZoomThread are applied. * * @param runnable * the code to run in order to apply the results - * @return true if the results were applied * @since 2.0 */ - protected boolean applyResults(Runnable runnable) { - return AbstractTimeGraphView.this.applyResults(runnable); + protected void applyResults(Runnable runnable) { + AbstractTimeGraphView.this.applyResults(runnable); } /** @@ -585,24 +585,22 @@ public abstract class AbstractTimeGraphView extends TmfView implements ITmfTimeA } /** - * Applies the results of the ZoomThread calculations on the UI thread. + * Applies the results of the ZoomThread calculations asynchronously on the + * UI thread. * <p> * Note: This method makes sure that only the results of the last created * ZoomThread are applied. * * @param runnable * the code to run in order to apply the results - * @return true if the results were applied * @since 3.1 */ - protected boolean applyResults(Runnable runnable) { + protected void applyResults(Runnable runnable) { synchronized (fZoomThreadResultLock) { if (Thread.currentThread() == fZoomThread) { Display.getDefault().asyncExec(runnable); - return true; } } - return false; } private class ZoomThreadByEntry extends ZoomThread { @@ -651,14 +649,17 @@ public abstract class AbstractTimeGraphView extends TmfView implements ITmfTimeA List<IMarkerEvent> markers = new ArrayList<>(getViewMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor())); /* Refresh the trace-specific markers when zooming */ markers.addAll(getTraceMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor())); - if (applyResults(() -> { + applyResults(() -> { if (links != null) { fTimeGraphViewer.setLinks(links); } fTimeGraphViewer.setMarkerCategories(getMarkerCategories()); fTimeGraphViewer.setMarkers(markers); - })) { - refresh(); + }); + synchronized (fZoomThreadResultLock) { + if (Thread.currentThread() == fZoomThread) { + refresh(); + } } } } |