1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

[284018] concurrent SubSystem.connect() calls can result in double login-prompt

This commit is contained in:
David McKnight 2009-07-20 15:23:47 +00:00
parent c0f678f895
commit 314fdbab31

View file

@ -47,6 +47,7 @@
* David McKnight (IBM) - [226787] [services] Dstore processes subsystem is empty after switching from shell processes * David McKnight (IBM) - [226787] [services] Dstore processes subsystem is empty after switching from shell processes
* David McKnight (IBM) - [262930] Remote System Details view not restoring filter memento input * David McKnight (IBM) - [262930] Remote System Details view not restoring filter memento input
* David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService()
* David McKnight (IBM) - [284018] concurrent SubSystem.connect() calls can result in double login-prompt
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
@ -2460,34 +2461,41 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
final Exception[] exception=new Exception[1]; final Exception[] exception=new Exception[1];
exception[0]=null; exception[0]=null;
Display.getDefault().syncExec(new Runnable() {
public void run() { IConnectorService conServ = getConnectorService();
try synchronized (conServ){
{ if (!conServ.isConnected()){
promptForPassword(promptForPassword); Display.getDefault().syncExec(new Runnable() {
} catch(Exception e) { public void run() {
exception[0]=e; try
} {
} promptForPassword(promptForPassword);
}); } catch(Exception e) {
try { exception[0]=e;
Exception e = exception[0];
if (e == null) {
getConnectorService().connect(monitor);
if (isConnected()) {
final SubSystem ss = this;
//Notify connect status change
Display.getDefault().asyncExec(new Runnable() {
public void run() {
RSECorePlugin.getTheSystemRegistry().connectedStatusChange(ss, true, false);
} }
}); }
} });
} else { }
throw e;
try {
Exception e = exception[0];
if (e == null) {
getConnectorService().connect(monitor);
if (isConnected()) {
final SubSystem ss = this;
//Notify connect status change
Display.getDefault().asyncExec(new Runnable() {
public void run() {
RSECorePlugin.getTheSystemRegistry().connectedStatusChange(ss, true, false);
}
});
}
} else {
throw e;
}
} finally {
monitor.done();
} }
} finally {
monitor.done();
} }
} }
} }