Browse Source

Fixed GitDaemon stop for unit tests

tags/v1.3.0
James Moger 11 years ago
parent
commit
2e4b03f7fe
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/main/java/com/gitblit/git/GitDaemon.java

+ 5
- 3
src/main/java/com/gitblit/git/GitDaemon.java View File

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

Loading…
Cancel
Save