未验证 提交 c1a76a06 编写于 作者: Y YHRivory 提交者: GitHub

typo: WhellTimer.Woker run method typo. (#10226)

上级 f1ca2b4f
......@@ -429,11 +429,8 @@ public class HashedWheelTimer implements Timer {
@Override
public void run() {
// Initialize the startTime.
startTime = System.nanoTime();
if (startTime == 0) {
// We use 0 as an indicator for the uninitialized value here, so make sure it's not 0 when initialized.
startTime = 1;
}
// We use 0 as an indicator for the uninitialized value here, so make sure it's not 0 when initialized.
startTime = Math.max(System.nanoTime(), 1);
// Notify the other threads waiting for the initialization at start().
startTimeInitialized.countDown();
......@@ -443,15 +440,14 @@ public class HashedWheelTimer implements Timer {
if (deadline > 0) {
int idx = (int) (tick & mask);
processCancelledTasks();
HashedWheelBucket bucket =
wheel[idx];
HashedWheelBucket bucket = wheel[idx];
transferTimeoutsToBuckets();
bucket.expireTimeouts(deadline);
tick++;
}
} while (WORKER_STATE_UPDATER.get(HashedWheelTimer.this) == WORKER_STATE_STARTED);
// Fill the unprocessedTimeouts so we can return them from stop() method.
// Fill the unprocessedTimeouts, so we can return them from stop() method.
for (HashedWheelBucket bucket : wheel) {
bucket.clearTimeouts(unprocessedTimeouts);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册