On Mon, 5 Jun 2023 18:52:00 GMT, Doug Lea <d...@openjdk.org> wrote: > This now uses Thread.isVirtual to distinguish spin vs immediate block cases, > enabling re-introduction of spin control from the previous version, removing > anomalies like this one.
This looks okay to me, it was a bit easier than I expected. The only comment I have is an interrupt while spinning won't be noticed until count goes to 0, that should be rare enough that it doesn't matter. We might have to tune SPIN_FOR_TIMEOUT_THRESHOLD at some point for virtual threads. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/14317#pullrequestreview-1464982532