diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java index caecc53ece5..281d8c5aa45 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2008 IBM Corporation and others. + * Copyright (c) 2002, 2012 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 @@ -25,6 +25,7 @@ * David McKnight (IBM) - [235221] Files truncated on exit of Eclipse * David McKnight (IBM) - [251631] NullPointerException in SystemTempFileListener * David McKnight (IBM) - [256048] Saving a member open in Remote LPEX editor while Working Offline doesn't set the dirty property + * David McKnight (IBM) - [381482] Improper use of save participant is causing a workspace hang *******************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -68,6 +69,7 @@ import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.progress.UIJob; import org.eclipse.ui.progress.WorkbenchJob; @@ -95,14 +97,15 @@ public abstract class SystemTempFileListener implements IResourceChangeListener } public void saving(ISaveContext context) throws CoreException { - // wait for completion of synch - while (isSynching()){ - try { - Thread.sleep(1000); - } - catch (Exception e){ - + if (PlatformUI.getWorkbench().isClosing() && + context.getKind() == ISaveContext.FULL_SAVE) { + while (isSynching()){ + try { + Thread.sleep(1000); + } + catch (Exception e){ + } } } }