[or-cvs] r15802: remove dead code from ProcessWaiter (puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/impl)
sebastian at seul.org
sebastian at seul.org
Wed Jul 9 15:16:04 UTC 2008
Author: sebastian
Date: 2008-07-09 11:16:04 -0400 (Wed, 09 Jul 2008)
New Revision: 15802
Modified:
puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java
Log:
remove dead code from ProcessWaiter
Modified: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java 2008-07-09 15:14:33 UTC (rev 15801)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java 2008-07-09 15:16:04 UTC (rev 15802)
@@ -483,15 +483,13 @@
* 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.
*/
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;
@@ -510,9 +508,6 @@
public void run() {
try {
this.exitValue = process.waitFor();
- synchronized (this) {
- notifyAll();
- }
} catch (InterruptedException e) {
}
}
@@ -527,12 +522,10 @@
* @return The exit value of the terminated process or 0 if the process
* is still running.
*/
- public synchronized int waitFor(long timeoutInMillis) {
- if (!finishedWaiting) {
- try {
- wait(timeoutInMillis);
- } catch (InterruptedException e) {
- }
+ public int waitFor(long timeoutInMillis) {
+ try {
+ sleep(timeoutInMillis);
+ } catch (InterruptedException e) {
}
this.interrupt();
return this.exitValue;
More information about the tor-commits
mailing list