diff options
author | Eugene Tarassov | 2013-03-20 16:22:01 +0000 |
---|---|---|
committer | Eugene Tarassov | 2013-03-20 16:22:01 +0000 |
commit | 13d34e54d875d8d582d92d902c50f39388ac4c66 (patch) | |
tree | 17b0a2b2a6028065d07be9cecd58e9cae75f8b3c /plugins | |
parent | 928a2327a2cfa58f3e14fbf564dc981aff5d9ef4 (diff) | |
download | org.eclipse.tcf-13d34e54d875d8d582d92d902c50f39388ac4c66.tar.gz org.eclipse.tcf-13d34e54d875d8d582d92d902c50f39388ac4c66.tar.xz org.eclipse.tcf-13d34e54d875d8d582d92d902c50f39388ac4c66.zip |
TCF Debugger: TCFLaunch.disconnect() changed to wait until the channel is closed.
It prevents bogus errors when Eclipse is closed while connected to a TCF target.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java index 5535096a9..d841a8861 100644 --- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java +++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others. + * Copyright (c) 2007, 2013 Wind River Systems, Inc. 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 @@ -141,6 +141,8 @@ public class TCFLaunch extends Launch { private boolean last_context_exited; private long actions_interval; + private final LinkedList<TCFTask<Boolean>> disconnect_wait_list = new LinkedList<TCFTask<Boolean>>(); + private final HashSet<Object> pending_clients = new HashSet<Object>(); private long pending_clients_timestamp; @@ -487,7 +489,11 @@ public class TCFLaunch extends Launch { runShutdownSequence(new Runnable() { public void run() { shutdown = true; - if (DebugPlugin.getDefault() != null) fireTerminate(); + fireTerminate(); + for (TCFTask<Boolean> tsk : disconnect_wait_list) { + tsk.done(Boolean.TRUE); + } + disconnect_wait_list.clear(); } }); // Log severe exceptions: bug 386067 @@ -1125,6 +1131,7 @@ public class TCFLaunch extends Launch { } else if (!connecting) { disconnected = true; + shutdown = true; } } fireChanged(); @@ -1356,16 +1363,20 @@ public class TCFLaunch extends Launch { @Override public void disconnect() throws DebugException { try { - new TCFTask<Boolean>() { + new TCFTask<Boolean>(8000) { public void run() { - closeChannel(); - done(true); + if (channel == null || shutdown) { + done(true); + } + else { + disconnect_wait_list.add(this); + closeChannel(); + } } }.get(); } catch (IllegalStateException x) { // Don't report this exception - it means Eclipse is being shut down - disconnected = true; } catch (Exception x) { throw new TCFError(x); |