Source:
<code>private void updateMemoryBrowserView(final Object context, final IMemoryBlockRetrieval retrieval, final ILaunch launch) { if (retrieval != null && launch != null && !launch.isTerminated()) { if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) { boolean suspended = false; if(context instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) context; IDMContext dmc = (IDMContext) adaptable.getAdapter(IDMContext.class); if (dmc != null) { IExecutionDMContext edmc = DMContexts.getAncestorOfType(dmc, IExecutionDMContext.class); if (edmc != null) { DsfServicesTracker tracker = new DsfServicesTracker(MemoryBrowserPlugin.getBundleContext(), dmc.getSessionId()); IRunControl rc = (IRunControl) tracker.getService(IRunControl.class); <START> if (rc != null && rc.isSuspended(edmc)) { <END> suspended = true; } tracker.dispose(); } } } boolean launching = false; if (suspended) { try { launching = launch.getLaunchConfiguration().getAttribute(ATTR_LAUNCHING, false); } catch (CoreException e1) { MemoryBrowserPlugin.getDefault().getLog().log(new Status(Status.ERROR, MemoryBrowserPlugin.PLUGIN_ID, "Could not get the launching attribute", e1)); } } if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) { final boolean finalLaunching = launching; ((IMemorySpaceAwareMemoryBlockRetrieval)retrieval).getMemorySpaces(context, new GetMemorySpacesRequest() { public void done() { updateTab(retrieval, context, isSuccess() ? getMemorySpaces() : new String[0]); if (finalLaunching && launch != null) { loadMemoryTabs(launch, context); } } }); } else { updateTab(retrieval, context, new String[0]); if (launching && launch != null) { loadMemoryTabs(launch, context); } } } else { updateTab(retrieval, context, new String[0]); } } else { fUnsupportedLabel.setText(""); handleUnsupportedSelection(); } }</code><technical_language>need in DsfExecutor thread do this. updateMemoryBrowserView is called (normally/always?) in main thread</technical_language>

Target:
private void updateMemoryBrowserView(final Object context, final IMemoryBlockRetrieval retrieval, final ILaunch launch) { if(retrieval != null && launch != null && !launch.isTerminated()) { if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) { boolean suspended = false; if(context instanceof IAdaptable) { IAdaptable adaptable = (IAdaptable) context; ISuspendResume targetElement = (ISuspendResume) adaptable.getAdapter(ISuspendResume.class); if (targetElement != null && targetElement.isSuspended()) { suspended = true; } } boolean launching = false; if (suspended) { launching = Boolean.valueOf(launch.getAttribute(ATTR_LAUNCHING)); } if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) { final boolean finalLaunching = launching; ((IMemorySpaceAwareMemoryBlockRetrieval)retrieval).getMemorySpaces(context, new GetMemorySpacesRequest() { public void done() { updateTab(retrieval, context, isSuccess() ? getMemorySpaces() : new String[0]); if (finalLaunching && launch != null) { loadMemoryTabs(launch, context); } } }); } else { updateTab(retrieval, context, new String[0]); if (launching && launch != null) { loadMemoryTabs(launch, context); } } } else { updateTab(retrieval, context, new String[0]); } } else { fUnsupportedLabel.setText(""); handleUnsupportedSelection(); } }