Skip to content

Commit 334df51

Browse files
EcljpseB0Tjukzi
authored andcommitted
Fix "Terminate and Relaunch" of groups that use adoptIfRunning #1318
This was a race condition: RuntimeProcess.fTerminated was only set asynchronously, hindering relaunching the process, thinking it was already running. Happened only for GroupLaunchElement.adoptIfRunning == true fixes #1318
1 parent 3a73b77 commit 334df51

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

debug/org.eclipse.debug.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.debug.core; singleton:=true
5-
Bundle-Version: 3.21.400.qualifier
5+
Bundle-Version: 3.21.500.qualifier
66
Bundle-Activator: org.eclipse.debug.core.DebugPlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

debug/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,12 @@ public void terminate() throws DebugException {
269269
try { // (in total don't wait longer than TERMINATION_TIMEOUT)
270270
long waitStart = System.currentTimeMillis();
271271
if (process.waitFor(TERMINATION_TIMEOUT, TimeUnit.MILLISECONDS)) {
272+
int exitValue = process.exitValue();
272273
synchronized (this) {
273-
fExitValue = process.exitValue();
274+
fExitValue = exitValue;
275+
// synchronously remember thread is terminated
276+
// before later asynchronously done in terminated():
277+
fTerminated = true;
274278
}
275279
if (waitFor(descendants, waitStart)) {
276280
return;

0 commit comments

Comments
 (0)