Backported fix for bug 371687: Deadlocks on workspace startup
diff --git a/org.eclipse.debug.core/META-INF/MANIFEST.MF b/org.eclipse.debug.core/META-INF/MANIFEST.MF
index 8d8545d..5956c56 100644
--- a/org.eclipse.debug.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.debug.core; singleton:=true
-Bundle-Version: 3.7.1.qualifier
+Bundle-Version: 3.7.2.qualifier
 Bundle-ClassPath: .
 Bundle-Activator: org.eclipse.debug.core.DebugPlugin
 Bundle-Vendor: %providerName
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 e3f9f5f..576f4de 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
@@ -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
@@ -678,8 +678,6 @@
 		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 5483ba2..442a331 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.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 @@
  */
 
 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 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 15c9de1..72e1458 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
@@ -57,8 +57,13 @@
 import org.eclipse.debug.core.model.IBreakpointImportParticipant;
 
 /**
- * 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
  */
@@ -398,13 +403,16 @@
 	}
 	
 	/**
-	 * 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();
 	}