**********************************************************************/
package net.sourceforge.phpdt.internal.debug.core.model;
+import net.sourceforge.phpdt.internal.debug.core.PHPDBGProxy;
+import net.sourceforge.phpdt.internal.debug.core.PHPDebugCorePlugin;
+
import org.eclipse.core.resources.IMarkerDelta;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IThread;
-import net.sourceforge.phpdt.internal.debug.core.PHPDebugCorePlugin;
-import net.sourceforge.phpdt.internal.debug.core.PHPDBGProxy;
-
/**
* Debug target for PHP debug model.
*/
}
public String getModelIdentifier() {
- return PHPDebugCorePlugin.getUniqueIdentifier();
+ return PHPDebugCorePlugin.PLUGIN_ID;
}
public IDebugTarget getDebugTarget() {
return isTerminated;
}
- public void terminate() {
+ 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
+ // thread that executes PHPLoop.run
+ if (isTerminated)
+ // Avoid terminating twice...
+ return;
phpDBGProxy.stop();
this.threads = new PHPThread[0];
isTerminated = true;