Fixed a case where HashedWheelTimer notifies a timeout one round later
This commit is contained in:
parent
bb6f5a6104
commit
afb7e511ad
@ -309,12 +309,12 @@ public class HashedWheelTimer implements Timer {
|
||||
List<HashedWheelTimeout> expiredTimeouts,
|
||||
ReusableIterator<HashedWheelTimeout> i) {
|
||||
|
||||
long currentTime = System.currentTimeMillis();
|
||||
long currentDeadline = System.currentTimeMillis() + tickDuration;
|
||||
i.rewind();
|
||||
while (i.hasNext()) {
|
||||
HashedWheelTimeout timeout = i.next();
|
||||
if (timeout.remainingRounds <= 0) {
|
||||
if (timeout.deadline <= currentTime) {
|
||||
if (timeout.deadline < currentDeadline) {
|
||||
i.remove();
|
||||
expiredTimeouts.add(timeout);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user