From 83b41ef2f777774ac72bc1cbb25cfcce8f86255d Mon Sep 17 00:00:00 2001 From: theli Date: Wed, 8 Jun 2005 13:44:25 +0000 Subject: [PATCH] *) Adding timeouts for shutdown git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@223 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaCrawlLoader.java | 3 ++- source/de/anomic/server/serverAbstractThread.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/plasma/plasmaCrawlLoader.java b/source/de/anomic/plasma/plasmaCrawlLoader.java index e7b2c2cbc..a1ec2a93f 100644 --- a/source/de/anomic/plasma/plasmaCrawlLoader.java +++ b/source/de/anomic/plasma/plasmaCrawlLoader.java @@ -141,7 +141,8 @@ public final class plasmaCrawlLoader extends Thread { this.interrupt(); // waiting for the thread to finish ... - this.join(); + this.log.logInfo("Waiting for plasmaCrawlLoader shutdown ..."); + this.join(5000); } catch (Exception e) { // we where interrupted while waiting for the crawlLoader Thread to finish } diff --git a/source/de/anomic/server/serverAbstractThread.java b/source/de/anomic/server/serverAbstractThread.java index c405a5110..ddee4469f 100644 --- a/source/de/anomic/server/serverAbstractThread.java +++ b/source/de/anomic/server/serverAbstractThread.java @@ -147,7 +147,7 @@ public abstract class serverAbstractThread extends Thread implements serverThrea // wait for termination if (waitFor) { // 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