On Mon, 21 Sep 2026 11:08:07 GMT, Alan Bateman <[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` 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).
>
> Marked as reviewed by alanb (Reviewer).

Thanks for the review @AlanBateman !

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

PR Comment: https://git.openjdk.org/jdk/pull/32977#issuecomment-5767113968

Reply via email to