Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2012-03-28 11:40:13 +0000
committerDani Megert2012-03-28 11:40:13 +0000
commit79038a3960ccc865356a29e06c097ebfaf4c446f (patch)
tree115edf25d9d0a971a6701ca56c6159ca787043d7
parent05f87406312175c3fe2fd8262d0b9a5f1ac1aa6e (diff)
downloadeclipse.platform.debug-79038a3960ccc865356a29e06c097ebfaf4c446f.tar.gz
eclipse.platform.debug-79038a3960ccc865356a29e06c097ebfaf4c446f.tar.xz
eclipse.platform.debug-79038a3960ccc865356a29e06c097ebfaf4c446f.zip
Fixed bug 371687: Deadlocks on workspace startupv20120328-1140
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java3
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java28
3 files changed, 32 insertions, 15 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
index 50a9cea30..3ba41eb5c 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
@@ -670,9 +670,6 @@ public class DebugPlugin extends Plugin {
manager.registerAdapters(actionFactory, ILaunch.class);
manager.registerAdapters(actionFactory, IProcess.class);
manager.registerAdapters(actionFactory, IDebugElement.class);
- getBreakpointManager();
- fBreakpointManager.start();
-
}
/**
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
index 16bd2058e..442a331cb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -28,6 +28,7 @@ import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager;
+import org.eclipse.debug.internal.core.BreakpointManager;
import org.eclipse.debug.internal.core.DebugCoreMessages;
/**
@@ -40,7 +41,17 @@ import org.eclipse.debug.internal.core.DebugCoreMessages;
*/
public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
-
+
+ /**
+ * Creates a breakpoint.
+ *
+ * @since 3.8
+ */
+ public Breakpoint() {
+ // Make sure that the breakpoint manager is initialized (for details see bug 54993)
+ ((BreakpointManager)DebugPlugin.getDefault().getBreakpointManager()).ensureInitialized();
+ }
+
/**
* Underlying marker.
*/
@@ -51,6 +62,7 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
*/
public void setMarker(IMarker marker) throws CoreException {
fMarker= marker;
+
}
/**
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
index 32552d3d2..18a65651c 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -55,9 +55,14 @@ import org.eclipse.debug.core.model.IBreakpointImportParticipant;
import com.ibm.icu.text.MessageFormat;
/**
- * The breakpoint manager manages all registered breakpoints
- * for the debug plug-in. It is instantiated by the debug plug-in at startup.
- *
+ * The breakpoint manager manages all registered breakpoints for the Debug plug-in. It is
+ * instantiated by the Debug plug-in at startup.
+ * <p>
+ * <strong>Note:</strong> This manager is created while the Debug plug-in is started, but it
+ * will not automatically be initialized. Client code that expects markers and breakpoints to be
+ * initialized must call {@link #ensureInitialized()}.
+ * </p>
+ *
* @see IBreakpointManager
*/
public class BreakpointManager implements IBreakpointManager, IResourceChangeListener {
@@ -399,18 +404,21 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
return temp;
}
-
+
/**
- * Perform any initialization of the manager.
- *
- * Called when {@link DebugPlugin#start(org.osgi.framework.BundleContext)} is called.
+ * Ensures that this manager is initialized.
+ * <p>
+ * This manager is created while the Debug plug-in is started, but it will not automatically
+ * be initialized. Client code that expects markers and breakpoints to be initialized must call
+ * this method.
+ * </p>
*
* @since 3.8
*/
- public void start() {
+ public void ensureInitialized() {
getBreakpoints0();
}
-
+
/**
* The BreakpointManager waits to load the breakpoints
* of the workspace until a request is made to retrieve the

Back to the top