-
Bug
-
Resolution: Fixed
-
P4
-
21, 22
-
b13
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8316378 | 21.0.2 | Robert Mckenna | P4 | Resolved | Fixed | b02 |
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).
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).
- backported by
-
JDK-8316378 VirtualThread.parkNanos timeout adjustment when pinned should be replaced
-
- Resolved
-