//\r
} finally {\r
acceptSocket = null;\r
- acceptThread = null;\r
}\r
+\r
}\r
};\r
acceptThread.start();\r
\r
/** Stop this daemon. */\r
public synchronized void stop() {\r
- if (acceptThread != null) {\r
- logger.info("Git Daemon stopping...");\r
+ if (isRunning() && acceptThread != null) {\r
run.set(false);\r
+ logger.info("Git Daemon stopping...");\r
try {\r
// close the accept socket\r
// this throws a SocketException in the accept thread\r
logger.info("Git Daemon stopped.");\r
} catch (InterruptedException e) {\r
logger.error("Accept thread join interrupted", e);\r
+ } finally {\r
+ acceptThread = null;\r
}\r
}\r
}\r