1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-27 19:05:38 +02:00

[381482] Improper use of save participant is causing a workspace hang

This commit is contained in:
David McKnight 2012-06-04 15:30:30 +00:00
parent 0e0c8676e3
commit 5c6ee54e7a

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * 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) - [235221] Files truncated on exit of Eclipse
* David McKnight (IBM) - [251631] NullPointerException in SystemTempFileListener * 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) - [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; 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.rse.ui.SystemBasePlugin;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob; import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.progress.WorkbenchJob; import org.eclipse.ui.progress.WorkbenchJob;
@ -95,14 +97,15 @@ public abstract class SystemTempFileListener implements IResourceChangeListener
} }
public void saving(ISaveContext context) throws CoreException { public void saving(ISaveContext context) throws CoreException {
// wait for completion of synch // wait for completion of synch
while (isSynching()){ if (PlatformUI.getWorkbench().isClosing() &&
try { context.getKind() == ISaveContext.FULL_SAVE) {
Thread.sleep(1000); while (isSynching()){
} try {
catch (Exception e){ Thread.sleep(1000);
}
catch (Exception e){
}
} }
} }
} }