VirtualThread.parkNanos timeout adjustment when pinned should be replaced

XMLWordPrintable

    • b13

        If yielding fails due to the pinning then VirtualThread.parkNanos parks on the carrier thread with the remaining time. The calculation of the remaining time should be changed to:

        long remainingNanos = nanos - (System.nanoTime() - startTime);

        The current code isn't correct for cases where System.nanoTimes return a negative value or when parking for durations close to Long.MAX_VALUE (292 years).

              Assignee:
              Alan Bateman
              Reporter:
              Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: