Skip to content
Permalink
Browse files
8286689: (se) Adjusting to select timeout after EINTR messed up after…
… JDK-8286378

Reviewed-by: dfuchs, alanb
  • Loading branch information
jaikiran committed May 13, 2022
1 parent 6a1b098 commit 0be1f3e1b0f4ac515a86e9f8e1999dc090b1bdd2
Showing 3 changed files with 3 additions and 3 deletions.
@@ -125,7 +125,7 @@ protected int doSelect(Consumer<SelectionKey> action, long timeout)
if (numEntries == IOStatus.INTERRUPTED && timedPoll) {
// timed poll interrupted so need to adjust timeout
long adjust = System.nanoTime() - startTime;
to =- (int) TimeUnit.NANOSECONDS.toMillis(adjust);
to -= (int) TimeUnit.NANOSECONDS.toMillis(adjust);
if (to <= 0) {
// timeout expired so no retry
numEntries = 0;
@@ -129,7 +129,7 @@ protected int doSelect(Consumer<SelectionKey> action, long timeout)
if (numEntries == IOStatus.INTERRUPTED && timedPoll) {
// timed poll interrupted so need to adjust timeout
long adjust = System.nanoTime() - startTime;
to -= TimeUnit.MILLISECONDS.convert(adjust, TimeUnit.NANOSECONDS);
to -= TimeUnit.NANOSECONDS.toMillis(adjust);
if (to <= 0) {
// timeout expired so no retry
numEntries = 0;
@@ -120,7 +120,7 @@ protected int doSelect(Consumer<SelectionKey> action, long timeout)
if (numPolled == IOStatus.INTERRUPTED && timedPoll) {
// timed poll interrupted so need to adjust timeout
long adjust = System.nanoTime() - startTime;
to =- (int) TimeUnit.NANOSECONDS.toMillis(adjust);
to -= (int) TimeUnit.NANOSECONDS.toMillis(adjust);
if (to <= 0) {
// timeout expired so no retry
numPolled = 0;

1 comment on commit 0be1f3e

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 0be1f3e May 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.