Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2007-05-11 18:56:49 +0000
committerMichael Rennie2007-05-11 18:56:49 +0000
commit3fc03328817334e4cc22b7563b889355a16289e3 (patch)
tree5a38c576a4133a8dbffd9d8b47e9a1a426b6f81a /org.eclipse.debug.ui
parent96586ea58d30a6e84752129e51e6943019f14778 (diff)
downloadeclipse.platform.debug-3fc03328817334e4cc22b7563b889355a16289e3.tar.gz
eclipse.platform.debug-3fc03328817334e4cc22b7563b889355a16289e3.tar.xz
eclipse.platform.debug-3fc03328817334e4cc22b7563b889355a16289e3.zip
Bug 186622
Deadlock trying to launch two configs at the same time
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java74
1 files changed, 39 insertions, 35 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
index b0ed256b9..1dcb74660 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
@@ -102,27 +102,29 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
* @param prepend whether the configuration should be added to the beginning of
* the history list
*/
- protected synchronized void addHistory(ILaunchConfiguration configuration, boolean prepend) {
- if(configuration.isWorkingCopy()) {
- return;
- }
- checkFavorites(configuration);
- int index = fCompleteHistory.indexOf(configuration);
- if(index == 0) {
- return;
- }
- if(index < 0) {
- if(prepend) {
- fCompleteHistory.add(0, configuration);
+ protected void addHistory(ILaunchConfiguration configuration, boolean prepend) {
+ synchronized (this) {
+ if(configuration.isWorkingCopy()) {
+ return;
+ }
+ checkFavorites(configuration);
+ int index = fCompleteHistory.indexOf(configuration);
+ if(index == 0) {
+ return;
+ }
+ if(index < 0) {
+ if(prepend) {
+ fCompleteHistory.add(0, configuration);
+ }
+ else {
+ fCompleteHistory.add(configuration);
+ }
}
else {
- fCompleteHistory.add(configuration);
+ fCompleteHistory.add(0, fCompleteHistory.remove(index));
}
+ resizeHistory();
}
- else {
- fCompleteHistory.add(0, fCompleteHistory.remove(index));
- }
- resizeHistory();
fireLaunchHistoryChanged();
}
@@ -375,25 +377,27 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
*/
- public synchronized void launchConfigurationRemoved(ILaunchConfiguration configuration) {
- ILaunchConfiguration newConfig = DebugPlugin.getDefault().getLaunchManager().getMovedTo(configuration);
- if (newConfig == null) {
- //deleted
- fCompleteHistory.remove(configuration);
- fFavorites.remove(configuration);
- } else {
- // moved/renamed
- int index = fCompleteHistory.indexOf(configuration);
- if (index >= 0) {
- fCompleteHistory.remove(index);
- fCompleteHistory.add(index, newConfig);
- }
- index = fFavorites.indexOf(configuration);
- if (index >= 0) {
- fFavorites.remove(index);
- fFavorites.add(index, newConfig);
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
+ synchronized (this) {
+ ILaunchConfiguration newConfig = DebugPlugin.getDefault().getLaunchManager().getMovedTo(configuration);
+ if (newConfig == null) {
+ //deleted
+ fCompleteHistory.remove(configuration);
+ fFavorites.remove(configuration);
+ } else {
+ // moved/renamed
+ int index = fCompleteHistory.indexOf(configuration);
+ if (index >= 0) {
+ fCompleteHistory.remove(index);
+ fCompleteHistory.add(index, newConfig);
+ }
+ index = fFavorites.indexOf(configuration);
+ if (index >= 0) {
+ fFavorites.remove(index);
+ fFavorites.add(index, newConfig);
+ }
+ checkFavorites(newConfig);
}
- checkFavorites(newConfig);
}
fireLaunchHistoryChanged();
}

Back to the top