diff options
author | Darin Wright | 2009-09-08 20:29:48 +0000 |
---|---|---|
committer | Darin Wright | 2009-09-08 20:29:48 +0000 |
commit | 2dc724990d055465d78c3b4f773ac0d1c5f6f6b2 (patch) | |
tree | 349d34bed2d549946db63ab8fcf4b94a5448daef | |
parent | 8cf2ad8fe075888d63c7794fbdefe3ae5eb5b587 (diff) | |
download | eclipse.platform.debug-2dc724990d055465d78c3b4f773ac0d1c5f6f6b2.tar.gz eclipse.platform.debug-2dc724990d055465d78c3b4f773ac0d1c5f6f6b2.tar.xz eclipse.platform.debug-2dc724990d055465d78c3b4f773ac0d1c5f6f6b2.zip |
Bug 261837 - RuntimeProcess should synchronize access to fTerminated and fExitValue
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java index 3bd24ed4e..4823fe8ae 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -111,7 +111,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess { fName= name; fTerminated= true; try { - process.exitValue(); + fExitValue = process.exitValue(); } catch (IllegalThreadStateException e) { fTerminated= false; } @@ -183,7 +183,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess { /** * @see ITerminate#isTerminated() */ - public boolean isTerminated() { + public synchronized boolean isTerminated() { return fTerminated; } @@ -230,15 +230,17 @@ public class RuntimeProcess extends PlatformObject implements IProcess { * has terminated. */ protected void terminated() { - if (fStreamsProxy instanceof StreamsProxy) { - ((StreamsProxy)fStreamsProxy).close(); - } - fTerminated= true; - try { - fExitValue = fProcess.exitValue(); - } catch (IllegalThreadStateException ie) { + synchronized (this) { + if (fStreamsProxy instanceof StreamsProxy) { + ((StreamsProxy)fStreamsProxy).close(); + } + fTerminated= true; + try { + fExitValue = fProcess.exitValue(); + } catch (IllegalThreadStateException ie) { + } + fProcess= null; } - fProcess= null; fireTerminateEvent(); } @@ -353,7 +355,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess { /** * @see IProcess#getExitValue() */ - public int getExitValue() throws DebugException { + public synchronized int getExitValue() throws DebugException { if (isTerminated()) { return fExitValue; } |