> 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.
Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Move JVMTI notifications to mount/unmount - Merge - Initial commit ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16194/files - new: https://git.openjdk.org/jdk/pull/16194/files/aa9587b7..b6462986 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16194&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16194&range=00-01 Stats: 10126 lines in 399 files changed: 7063 ins; 1412 del; 1651 mod Patch: https://git.openjdk.org/jdk/pull/16194.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16194/head:pull/16194 PR: https://git.openjdk.org/jdk/pull/16194