Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-11-08 04:35:38 -0500
committerAndrey Loskutov2018-11-08 04:35:38 -0500
commit1134996d8fe85132f982e53c6d9de9435161443b (patch)
treed8f67e1e6bb8cbbd154f8abb7810419abfec29c1
parent0f48910ff189c860599be29c65d86b20fc937597 (diff)
downloadeclipse.platform.debug-1134996d8fe85132f982e53c6d9de9435161443b.tar.gz
eclipse.platform.debug-1134996d8fe85132f982e53c6d9de9435161443b.tar.xz
eclipse.platform.debug-1134996d8fe85132f982e53c6d9de9435161443b.zip
Do not lock BreakpointManager in the call to enableTriggerPoints() - it will try to acquire workspace lock while modifying markers, and this can deadlock with other threads trying to access BreakpointManager while holding the workspace lock. Instead, lock on fTriggerPointDisabledList instance. Change-Id: I03c9fba2d8ec84dad0f7f1a598cbe8a908c9d94a Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java15
1 files changed, 10 insertions, 5 deletions
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 c738aaa3a..6b3ed75bb 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
@@ -1421,22 +1421,24 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
@Override
- public synchronized void enableTriggerPoints(IBreakpoint[] triggerPoints, boolean enable) {
+ public void enableTriggerPoints(IBreakpoint[] triggerPoints, boolean enable) {
IBreakpoint[] triggerPointArray = triggerPoints;
if (triggerPoints == null) {
if (enable) {
- triggerPointArray = fTriggerPointDisabledList.toArray(new IBreakpoint[0]);
+ synchronized (fTriggerPointDisabledList) {
+ triggerPointArray = fTriggerPointDisabledList.toArray(new IBreakpoint[0]);
+ }
} else {
triggerPointArray = getTriggerPoints();
- fTriggerPointDisabledList.clear();
}
}
+ List<IBreakpoint> toDisable = new ArrayList<>();
for (IBreakpoint iBreakpoint : triggerPointArray) {
try {
IMarker m = iBreakpoint.getMarker();
if (m != null && m.exists()) {
if (!enable && iBreakpoint.isEnabled()) {
- fTriggerPointDisabledList.add(iBreakpoint);
+ toDisable.add(iBreakpoint);
}
iBreakpoint.setEnabled(enable);
}
@@ -1444,8 +1446,11 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
// ignore
}
}
- if (enable) {
+ synchronized (fTriggerPointDisabledList) {
fTriggerPointDisabledList.clear();
+ if (!enable) {
+ fTriggerPointDisabledList.addAll(toDisable);
+ }
}
}

Back to the top