Made sure HashedWheelTimer.newTimeout does not throw an IllegalArgumentException for small delay
This commit is contained in:
parent
188c7f94aa
commit
c46be1c7f9
@ -194,7 +194,9 @@ public class HashedWheelTimer implements Timer {
|
||||
}
|
||||
|
||||
delay = unit.toNanos(delay);
|
||||
checkDelay(delay);
|
||||
if (delay < tickDuration) {
|
||||
delay = tickDuration;
|
||||
}
|
||||
|
||||
if (!workerThread.isAlive()) {
|
||||
start();
|
||||
@ -237,13 +239,6 @@ public class HashedWheelTimer implements Timer {
|
||||
return true;
|
||||
}
|
||||
|
||||
void checkDelay(long delay) {
|
||||
if (delay < tickDuration) {
|
||||
throw new IllegalArgumentException(
|
||||
"delay must be greater than " + tickDuration + " nanoseconds");
|
||||
}
|
||||
}
|
||||
|
||||
private final class Worker implements Runnable {
|
||||
|
||||
private long startTime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user