[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r15805: backport r15802 from my branch to main PuppeTor (puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl)
Author: sebastian
Date: 2008-07-09 11:24:30 -0400 (Wed, 09 Jul 2008)
New Revision: 15805
Modified:
puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java
Log:
backport r15802 from my branch to main PuppeTor
Modified: puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java
===================================================================
--- puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java 2008-07-09 15:23:35 UTC (rev 15804)
+++ puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java 2008-07-09 15:24:30 UTC (rev 15805)
@@ -489,15 +489,15 @@
* terminate, the exit value will be 0; otherwise it will contain the exit
* code of the terminated process. This functionality is added, because it
* is not provided by Process.
+ * This class is not threadsafe.
+ * XXX Some stuff in here looks still dodgy. What happens if we get an
+ * InterruptedException in run and thus don't set exitValue?-SH
*/
private class ProcessWaiter extends Thread {
/** The process to wait for. */
private Process process;
- /** Did we finish waiting? */
- private boolean finishedWaiting;
-
/** The exit value or 0 if the process is still running. */
private int exitValue;
@@ -516,9 +516,6 @@
public void run() {
try {
this.exitValue = process.waitFor();
- synchronized (this) {
- notifyAll();
- }
} catch (InterruptedException e) {
}
}
@@ -534,11 +531,9 @@
* is still running.
*/
public synchronized int waitFor(long timeoutInMillis) {
- if (!finishedWaiting) {
- try {
- wait(timeoutInMillis);
- } catch (InterruptedException e) {
- }
+ try {
+ sleep(timeoutInMillis);
+ } catch (InterruptedException e) {
}
this.interrupt();
return this.exitValue;