On Sat, 14 Oct 2023 18:07:45 GMT, Alan Bateman <al...@openjdk.org> wrote:
> JVMTI is notified after a virtual thread unmounts. Right not, this > notification is done after the virtual thread has finished parking or > yielding so it's possible for the virtual to continue, and be mounted on a > different carrier, before the unmount notification has completed on the > original carrier. If this happens it means the the JVMTI mount and unmount > notifications will race and it's possible they could be unbalanced. The > unmount notification needs to move to after the unmount and before the > virtual thread state is changed. > > While in the area, I've removed @ChangesCurrentThread from VirtualThread.run. > This annotation was in place to workaround an issue with the notifyJvmtiXXX > instrinsics, fixed recently by JDK-8316130. > > Testing: tier1-6. LGTM. ------------- Marked as reviewed by mli (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16194#pullrequestreview-1678813750