Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) Trying to bugfix shutdown problem

theli64b2ef5aae72
diff --git a/source/yacy.java b/source/yacy.java
index f2c6b4357..1cd526e6b 100644
--- a/source/yacy.java
+++ b/source/yacy.java
@@ -1411,7 +1411,9 @@ class shutdownHookThread extends Thread {
// waiting for the yacy thread to finish execution
serverLog.logFine("SHUTDOWN","Waiting for main thread to finish.");
- this.mainThread.join();
+ if (this.mainThread.isAlive() && !this.sb.isTerminated()) {
+ this.mainThread.join();
+ }
}
} catch (Exception e) {
serverLog.logSevere("SHUTDOWN","Unexpected error. " + e.getClass().getName(),e);