From: Genevieve Bastien Date: Sun, 9 Oct 2016 09:45:38 +0000 (-0400) Subject: tmf: Update data in common XY chart outside the UI thread X-Git-Url: http://git.efficios.com/?p=deliverable%2Ftracecompass.git;a=commitdiff_plain;h=70cc35709260a9e7ae19ac54b9334f397e8d46e4 tmf: Update data in common XY chart outside the UI thread Change-Id: Id7e991dab24bd0ba6dce062a9e477c50664587c0 Signed-off-by: Genevieve Bastien Reviewed-on: https://git.eclipse.org/r/82796 Reviewed-by: Matthew Khouzam Tested-by: Matthew Khouzam Reviewed-by: Hudson CI --- diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/linecharts/TmfCommonXLineChartViewer.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/linecharts/TmfCommonXLineChartViewer.java index 8f55d8be08..9bab341ce8 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/linecharts/TmfCommonXLineChartViewer.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/linecharts/TmfCommonXLineChartViewer.java @@ -190,22 +190,15 @@ public abstract class TmfCommonXLineChartViewer extends TmfXYChartViewer { @Override public void run() { LOGGER.info(() -> getLogMessage("UpdateThreadStart", "numRequests=" + fNumRequests + ", tid=" + getId())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - LOGGER.info(() -> getLogMessage("UpdateDataStart", "tid=" + getId())); //$NON-NLS-1$ //$NON-NLS-2$ - try { - updateData(getWindowStartTime(), getWindowEndTime(), fNumRequests, fMonitor); - } finally { - /* - * fDirty should have been incremented before creating - * the thread, so we decrement it once it is finished - */ - fDirty.decrementAndGet(); - LOGGER.info(() -> getLogMessage("UpdateDataEnd", "tid=" + getId())); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - }); + try { + updateData(getWindowStartTime(), getWindowEndTime(), fNumRequests, fMonitor); + } finally { + /* + * fDirty should have been incremented before creating the + * thread, so we decrement it once it is finished + */ + fDirty.decrementAndGet(); + } updateThreadFinished(this); LOGGER.info(() -> getLogMessage("UpdateThreadEnd", "tid=" + getId())); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -399,6 +392,7 @@ public abstract class TmfCommonXLineChartViewer extends TmfXYChartViewer { @Override public void run() { try { + LOGGER.info(() -> getLogMessage("UpdateDisplayStart", null)); //$NON-NLS-1$ if (!getSwtChart().isDisposed()) { double[] xValues = fXValues; double maxy = DEFAULT_MAXY; @@ -445,10 +439,12 @@ public abstract class TmfCommonXLineChartViewer extends TmfXYChartViewer { TmfSignalManager.dispatchSignal(new TmfTimeViewAlignmentSignal(TmfCommonXLineChartViewer.this, timeAlignmentInfo, true)); } } + LOGGER.info(() -> getLogMessage("UpdateDisplayEnd", null)); //$NON-NLS-1$ } finally { /* Content has been updated, decrement dirtiness */ fDirty.decrementAndGet(); } + } }); }