8286689: (se) Adjusting to select timeout after EINTR messed up after JDK-8286378

Reviewed-by: dfuchs, alanb
This commit is contained in:
Jaikiran Pai 2022-05-13 11:08:50 +00:00
parent 6a1b09898d
commit 0be1f3e1b0
3 changed files with 3 additions and 3 deletions

View file

@ -129,7 +129,7 @@ class KQueueSelectorImpl extends SelectorImpl {
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;