Proposal for fix related to 1rst issue of #345

=> in configure (newcheckInterval/10)*10
(see http://www.javamex.com/tutorials/threads/sleep_issues.shtml)
This commit is contained in:
Frédéric Brégier 2012-05-19 14:59:52 +03:00
parent 2320a5919f
commit bc540d5ee1

View File

@ -248,9 +248,10 @@ public class TrafficCounter {
* @param newcheckInterval
*/
public void configure(long newcheckInterval) {
if (checkInterval.get() != newcheckInterval) {
checkInterval.set(newcheckInterval);
if (newcheckInterval <= 0) {
long newInterval = (newcheckInterval/10)*10;
if (checkInterval.get() != newInterval) {
checkInterval.set(newInterval);
if (newInterval <= 0) {
stop();
// No more active monitoring
lastTime.set(System.currentTimeMillis());