X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java index afce149..00f460a 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java @@ -107,6 +107,11 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget, fireThreadCreateEvent(phpThread); } + public void updateThreads (PHPThread phpThread) { + fireChangeEvent (); + fireThreadCreateEvent (phpThread); + } + private void fireChangeEvent() { DebugEvent ev = new DebugEvent(this, DebugEvent.CHANGE); DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev }); @@ -117,14 +122,14 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget, DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev }); } - protected PHPThread getThreadById(int id) { - for (int i = 0; i < threads.length; i++) { - if (threads[i].getId() == id) { - return threads[i]; - } - } - return null; - } +// protected PHPThread getThreadById(int id) { +// for (int i = 0; i < threads.length; i++) { +// if (threads[i].getId() == id) { +// return threads[i]; +// } +// } +// return null; +// } public IThread[] getThreads() { return threads; @@ -169,6 +174,17 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget, return state.isTerminated(); } + private synchronized void terminateThreads () { + int i; + + try { + for (i = 0; i < threads.length; i++) { + threads[i].terminate (); + } + } catch (DebugException e) { + } + } + public synchronized void terminate() { // This method is synchronized to control a race condition between the // UI thread that terminates the debugging session, and the slave @@ -178,6 +194,7 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget, return; state.setTerminated(true); phpDBGProxy.stop(); + terminateThreads (); this.threads = new PHPThread[0]; fireChangeEvent(); IBreakpointManager manager = DebugPlugin.getDefault()