*) Adding timeouts for shutdown

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@223 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 20 years ago
parent ef6851798b
commit 83b41ef2f7

@ -141,7 +141,8 @@ public final class plasmaCrawlLoader extends Thread {
this.interrupt(); this.interrupt();
// waiting for the thread to finish ... // waiting for the thread to finish ...
this.join(); this.log.logInfo("Waiting for plasmaCrawlLoader shutdown ...");
this.join(5000);
} catch (Exception e) { } catch (Exception e) {
// we where interrupted while waiting for the crawlLoader Thread to finish // we where interrupted while waiting for the crawlLoader Thread to finish
} }

@ -147,7 +147,7 @@ public abstract class serverAbstractThread extends Thread implements serverThrea
// wait for termination // wait for termination
if (waitFor) { if (waitFor) {
// Busy waiting removed: while (this.isAlive()) try {this.sleep(100);} catch (InterruptedException e) {break;} // Busy waiting removed: while (this.isAlive()) try {this.sleep(100);} catch (InterruptedException e) {break;}
try { this.join(); } catch (InterruptedException e) {return;} try { this.join(3000); } catch (InterruptedException e) {return;}
} }
// If we reach this point, the process is closed // If we reach this point, the process is closed

Loading…
Cancel
Save