Skip to content

Commit

Permalink
Fix "Terminate and Relaunch" of groups that use adoptIfRunning #1318
Browse files Browse the repository at this point in the history
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
  • Loading branch information
EcljpseB0T committed Jun 6, 2024
1 parent 835216f commit faf27df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debug/org.eclipse.debug.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.debug.core; singleton:=true
Bundle-Version: 3.21.400.qualifier
Bundle-Version: 3.21.500.qualifier
Bundle-Activator: org.eclipse.debug.core.DebugPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,12 @@ public void terminate() throws DebugException {
try { // (in total don't wait longer than TERMINATION_TIMEOUT)
long waitStart = System.currentTimeMillis();
if (process.waitFor(TERMINATION_TIMEOUT, TimeUnit.MILLISECONDS)) {
int exitValue = process.exitValue();
synchronized (this) {
fExitValue = process.exitValue();
fExitValue = exitValue;
// synchronously remember thread is terminated
// before later asynchronously done in terminated():
fTerminated = true;
}
if (waitFor(descendants, waitStart)) {
return;
Expand Down

0 comments on commit faf27df

Please sign in to comment.