More aggressively breaking chains in order to prevent nodes promoted to older generations standing in the way for collecting younger nodes. I decided that it was most efficient to add this logic to the else-branch of updating the firstWaiter and lastWaiter.
There's a race with unlinkCancelledWaiters() but according to @DougLea it should be a benign one. There's a performance impact of this, but as it is a plain write, and one to null at that, it should be acceptable. ------------- Commit messages: - Minimizes the risk of AQS & AQLS waiter queues to be prematurely promoted to old gen Changes: https://git.openjdk.org/jdk/pull/17950/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17950&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8325754 Stats: 10 lines in 2 files changed: 10 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/17950.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17950/head:pull/17950 PR: https://git.openjdk.org/jdk/pull/17950