From d655eed87759e0592026e472dbb3b10b59e93746 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Mon, 10 Nov 2003 23:15:04 +0000 Subject: [PATCH] Ensure that all breakpoint creation and modification operations are running in the UI thread. --- debug/org.eclipse.cdt.debug.core/ChangeLog | 4 + .../internal/core/CBreakpointManager.java | 75 ++++++++++++++++++- 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index a0b0a56db8d..0b70704c4f9 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,7 @@ +2003-11-10 Mikhail Khodjaiants + Ensure that all breakpoint creation and modification operations are running in the UI thread. + * CBreakpointManager.java + 2003-11-10 Mikhail Khodjaiants Added synchronization to some of the 'CBreakpoint' methods. * CBreakpoint.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java index 3885dc9fff6..8a2a2801715 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java @@ -291,7 +291,25 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene return 0; } - public void setBreakpoint( ICBreakpoint breakpoint ) throws DebugException + public void setBreakpoint( final ICBreakpoint breakpoint ) throws DebugException + { + Runnable runnable = new Runnable() + { + public void run() + { + try + { + doSetBreakpoint( breakpoint ); + } + catch( DebugException e ) + { + } + } + }; + CDebugCorePlugin.getDefault().asyncExec( runnable ); + } + + protected void doSetBreakpoint( ICBreakpoint breakpoint ) throws DebugException { try { @@ -327,7 +345,25 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene } } - public void removeBreakpoint( ICBreakpoint breakpoint ) throws DebugException + public void removeBreakpoint( final ICBreakpoint breakpoint ) throws DebugException + { + Runnable runnable = new Runnable() + { + public void run() + { + try + { + doRemoveBreakpoint( breakpoint ); + } + catch( DebugException e ) + { + } + } + }; + CDebugCorePlugin.getDefault().asyncExec( runnable ); + } + + protected void doRemoveBreakpoint( ICBreakpoint breakpoint ) throws DebugException { ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); if ( cdiBreakpoint != null ) @@ -344,7 +380,25 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene } } - public void changeBreakpointProperties( ICBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException + public void changeBreakpointProperties( final ICBreakpoint breakpoint, final IMarkerDelta delta ) throws DebugException + { + Runnable runnable = new Runnable() + { + public void run() + { + try + { + doChangeBreakpointProperties( breakpoint, delta ); + } + catch( DebugException e ) + { + } + } + }; + CDebugCorePlugin.getDefault().asyncExec( runnable ); + } + + protected void doChangeBreakpointProperties( ICBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException { ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); if ( cdiBreakpoint == null ) @@ -481,7 +535,20 @@ public class CBreakpointManager implements ICBreakpointManager, ICDIEventListene } } - private void handleBreakpointDestroyedEvent( ICDIBreakpoint cdiBreakpoint ) + private void handleBreakpointDestroyedEvent( final ICDIBreakpoint cdiBreakpoint ) + { + Runnable runnable = new Runnable() + { + public void run() + { + doHandleBreakpointDestroyedEvent( cdiBreakpoint ); + } + + }; + CDebugCorePlugin.getDefault().asyncExec( runnable ); + } + + protected void doHandleBreakpointDestroyedEvent( ICDIBreakpoint cdiBreakpoint ) { ICBreakpoint breakpoint = getBreakpointMap().getCBreakpoint( cdiBreakpoint ); if ( breakpoint != null )