> The `GetThreadSnapshotHandshakeClosure` was added to support virtual threads > in thread dumps. It is very similar to the logic used in the old > safepoint-based thread dump. > `GetThreadSnapshotHandshakeClosure::detect_locks` uses the raw > `javaVFrame::monitors()` method rather than using the `locked_monitors()` > method which already filters out some monitors including those for which > `wait()` has been called. It uses the raw `monitors()` list because it wants > to process eliminated compiled monitors itself, and they are already removed > from `locked_monitors()`. But that means it should be doing its own filtering > of monitors that are being waited-on so they are not reported as locked. This > seems to have been an oversight with the original implementation. > > I also fixed a pre-existing typo whilst in this code. > > Testing > - tiers 1-3 > - updated tests in the PR > > Thanks > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
David Holmes has updated the pull request incrementally with one additional commit since the last revision: Update the logic to check that the waiting thread has actually released the monitor. Update test accordingly to force release.x ------------- Changes: - all: https://git.openjdk.org/jdk/pull/32977/files - new: https://git.openjdk.org/jdk/pull/32977/files/2d551904..eab068b5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=32977&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=32977&range=00-01 Stats: 71 lines in 2 files changed: 41 ins; 0 del; 30 mod Patch: https://git.openjdk.org/jdk/pull/32977.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/32977/head:pull/32977 PR: https://git.openjdk.org/jdk/pull/32977
