From afb7e511ada4c1c95ce7e84a66cc096a9cc7359c Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 5 Jun 2009 17:05:42 +0000 Subject: [PATCH] Fixed a case where HashedWheelTimer notifies a timeout one round later --- src/main/java/org/jboss/netty/util/HashedWheelTimer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jboss/netty/util/HashedWheelTimer.java b/src/main/java/org/jboss/netty/util/HashedWheelTimer.java index aa1a808c72..58766bc0cc 100644 --- a/src/main/java/org/jboss/netty/util/HashedWheelTimer.java +++ b/src/main/java/org/jboss/netty/util/HashedWheelTimer.java @@ -309,12 +309,12 @@ public class HashedWheelTimer implements Timer { List expiredTimeouts, ReusableIterator 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 {