On Fri, 20 Feb 2026 09:26:52 GMT, Alan Bateman <[email protected]> wrote:
> Thread.join was historically implemented with a loop of Object.wait > conditioned on isAlive. We couldn't for this virtual threads because it would > pin a virtual thread invoking join to it carrier. Now that Object.wait > preempts, it means the special implementation of join for virtual threads can > be removed. Where possible, the notifyAll is elided as it adds to the cost of > termination. > > The implNote of the join methods is restored (this is implNote text, not > spec, so no CSR required). > > Testing: tier1-5 src/java.base/share/classes/java/lang/VirtualThread.java line 188: > 186: > 187: // termination object when joining, created lazily if needed > 188: private volatile CountDownLatch termination; Nit - I suspect the CountDownLatch import can be removed too? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29839#discussion_r2857064073
