From a4eb64dd8daad83f5f284ec63407a86257389666 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Tue, 8 Mar 2011 14:58:46 +0000 Subject: [PATCH] [267478] [dstore] Invalid thread access thrown calling the DStoreFileService.download method --- .../rse/services/dstore/util/DownloadListener.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java index b7ad58f3ae4..ee69aa35188 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2011 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the terms * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -19,6 +19,7 @@ * David McKnight (IBM) - [222448] [dstore] update DownloadListener to handle timeouts and nudge * David McKnight (IBM) - [225902] [dstore] use C_NOTIFICATION command to wake up the server * David McKnight (IBM) - [231126] [dstore] status monitor needs to reset WaitThreshold on nudge + * David McKnight (IBM) - [267478] [dstore] Invalid thread access thrown calling the DStoreFileService.download method ********************************************************************************/ package org.eclipse.rse.services.dstore.util; @@ -29,6 +30,7 @@ import java.io.File; import java.text.MessageFormat; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IProgressMonitorWithBlocking; import org.eclipse.dstore.core.model.DE; import org.eclipse.dstore.core.model.DataElement; import org.eclipse.dstore.core.model.DataStore; @@ -149,8 +151,11 @@ public class DownloadListener implements IDomainListener long delta = currentLength - _totalBytesNotified; if (delta > 0) { - //System.out.println(_status.getAttribute(DE.A_SOURCE)); - _monitor.worked((int)delta); + try { // certain progress monitors can't do work when not on main thread + _monitor.worked((int)delta); + } + catch (Exception e){ + } try {