clear up a race where the timestamper might be fired when it shouldnt be

This commit is contained in:
jrandom
2004-08-24 00:46:31 +00:00
committed by zzz
parent 8e53028d78
commit a2b86acc22

View File

@ -20,7 +20,7 @@ public class Timestamper implements Runnable {
private List _servers;
private List _listeners;
private int _queryFrequency;
private boolean _disabled;
private volatile boolean _disabled;
private boolean _daemon;
private static final int DEFAULT_QUERY_FREQUENCY = 5*60*1000;
@ -102,6 +102,7 @@ public class Timestamper implements Runnable {
_log.info("Starting up timestamper");
try {
while (true) {
updateConfig();
if (!_disabled) {
String serverList[] = null;
synchronized (_servers) {
@ -120,7 +121,6 @@ public class Timestamper implements Runnable {
_log.log(Log.CRIT, "Unable to reach any of the NTP servers - network disconnected?");
}
}
updateConfig();
try { Thread.sleep(_queryFrequency); } catch (InterruptedException ie) {}
}
} catch (Throwable t) {