On Mon, 21 Sep 2026 08:03:05 GMT, David Holmes <[email protected]> wrote:

> 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` using 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).

Marked as reviewed by alanb (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/32977#pullrequestreview-5265888532

Reply via email to