mirror of https://github.com/apache/activemq.git
use schedule instead of scheduleAtFixedRate since we don't need read or write check tasks to "catch up" if delayed for some reason only to fire once the resources allow for it and then return to the standard delay for the next execution. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1150917 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e34ec0b7f0
commit
e4dfd570b9
|
@ -315,8 +315,8 @@ public class InactivityMonitor extends TransportFilter {
|
|||
WRITE_CHECK_TIMER = new Timer("InactivityMonitor WriteCheck",true);
|
||||
}
|
||||
CHECKER_COUNTER++;
|
||||
WRITE_CHECK_TIMER.scheduleAtFixedRate(writeCheckerTask, initialDelayTime,writeCheckTime);
|
||||
READ_CHECK_TIMER.scheduleAtFixedRate(readCheckerTask, initialDelayTime,readCheckTime);
|
||||
WRITE_CHECK_TIMER.schedule(writeCheckerTask, initialDelayTime, writeCheckTime);
|
||||
READ_CHECK_TIMER.schedule(readCheckerTask, initialDelayTime, readCheckTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -356,8 +356,8 @@ public class InactivityMonitor extends TransportFilter {
|
|||
READ_CHECK_TIMER.purge();
|
||||
CHECKER_COUNTER--;
|
||||
if(CHECKER_COUNTER==0) {
|
||||
WRITE_CHECK_TIMER.cancel();
|
||||
READ_CHECK_TIMER.cancel();
|
||||
WRITE_CHECK_TIMER.cancel();
|
||||
READ_CHECK_TIMER.cancel();
|
||||
WRITE_CHECK_TIMER = null;
|
||||
READ_CHECK_TIMER = null;
|
||||
ASYNC_TASKS.shutdownNow();
|
||||
|
|
Loading…
Reference in New Issue