Keep references to threads and shut them down more properly

This commit is contained in:
Edward Capriolo
2015-01-12 22:41:21 -05:00
parent 5072be6636
commit 6565b03192
4 changed files with 34 additions and 8 deletions

View File

@ -18,7 +18,7 @@ abstract public class ActiveGossipThread implements Runnable {
private GossipManager _gossipManager;
private AtomicBoolean _keepRunning;
private final AtomicBoolean _keepRunning;
public ActiveGossipThread(GossipManager gossipManager) {
_gossipManager = gossipManager;
@ -36,10 +36,12 @@ abstract public class ActiveGossipThread implements Runnable {
_keepRunning.set(false);
}
}
_keepRunning = null;
shutdown();
}
public void shutdown(){
_keepRunning.set(false);
}
/**
* Performs the sending of the membership list, after we have
* incremented our own heartbeat.