GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ManualIoEventLoop: Correctly calculate delayNanos and deadlineNanos (… · netty/netty@620794f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • transport/src/main/java/io/netty/channel
    • ManualIoEventLoop.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎transport/src/main/java/io/netty/channel/ManualIoEventLoop.java‎

Copy file name to clipboardExpand all lines: transport/src/main/java/io/netty/channel/ManualIoEventLoop.java
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,17 +531,18 @@ public boolean canBlock() {
531531
@Override
532532
public long delayNanos(long currentTimeNanos) {
533533
assert inEventLoop();
534-
return ManualIoEventLoop.this.delayNanos(currentTimeNanos, maxBlockingNanos);
534+
return Math.min(maxBlockingNanos, ManualIoEventLoop.this.delayNanos(currentTimeNanos, maxBlockingNanos));
535535
}
536536

537537
@Override
538538
public long deadlineNanos() {
539539
assert inEventLoop();
540540
long next = nextScheduledTaskDeadlineNanos();
541+
long maxDeadlineNanos = getCurrentTimeNanos() + maxBlockingNanos;
541542
if (next == -1) {
542-
return maxBlockingNanos;
543+
return maxDeadlineNanos;
543544
}
544-
return Math.min(next, maxBlockingNanos);
545+
return Math.min(next, maxDeadlineNanos);
545546
}
546547
};
547548
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.