You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by je...@apache.org on 2006/01/11 18:06:29 UTC

svn commit: r368060 - /lucene/nutch/trunk/src/java/org/apache/nutch/util/CommandRunner.java

Author: jerome
Date: Wed Jan 11 09:06:27 2006
New Revision: 368060

URL: http://svn.apache.org/viewcvs?rev=368060&view=rev
Log:
NUTCH-151, Enter barrier before returning from PumperThread.run()

Modified:
    lucene/nutch/trunk/src/java/org/apache/nutch/util/CommandRunner.java

Modified: lucene/nutch/trunk/src/java/org/apache/nutch/util/CommandRunner.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/trunk/src/java/org/apache/nutch/util/CommandRunner.java?rev=368060&r1=368059&r2=368060&view=diff
==============================================================================
--- lucene/nutch/trunk/src/java/org/apache/nutch/util/CommandRunner.java (original)
+++ lucene/nutch/trunk/src/java/org/apache/nutch/util/CommandRunner.java Wed Jan 11 09:06:27 2006
@@ -43,7 +43,6 @@
   private boolean _waitForExit = true;
   private String _command;
   private int _timeout = 10;
-  private boolean _destroyOnTimeout = true;
 
   private InputStream _stdin;
   private OutputStream _stdout;
@@ -123,9 +122,6 @@
       }
     } catch (TimeoutException ex) {
       _timedout = true;
-      if (_destroyOnTimeout) {
-        proc.destroy();
-      }
     } catch (BrokenBarrierException bbe) {
       /* IGNORE */
     } catch (InterruptedException e) {
@@ -167,10 +163,8 @@
       }
     }
 
-    if (_timedout) {
-      if (_destroyOnTimeout) {
-        proc.destroy();
-      }
+    if (_waitForExit) {
+      proc.destroy();
     }
     return _xit;
   }
@@ -222,6 +216,13 @@
           /* IGNORE */
         }
       }
+      try {
+         _barrier.barrier();
+       } catch (InterruptedException ie) {
+         /* IGNORE */
+       } catch (BrokenBarrierException bbe) {
+         /* IGNORE */
+       }
     }
   }
 
@@ -243,14 +244,6 @@
 
   public void setTimeout(int timeout) {
     _timeout = timeout;
-  }
-
-  public boolean getDestroyOnTimeout() {
-    return _destroyOnTimeout;
-  }
-
-  public void setDestroyOnTimeout(boolean destroyOnTimeout) {
-    _destroyOnTimeout = destroyOnTimeout;
   }
 
   public boolean getWaitForExit() {