RFR: 8365057: Add support for java.util.concurrent lock information to Thread.dump_to_file
Alan Bateman
alanb at openjdk.org
Wed Sep 24 07:07:17 UTC 2025
On Wed, 24 Sep 2025 06:38:07 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> The fix updates `jcmd Thread.dump_to_file`/`HotSpotDiagnosticMXBean.dumpThreads` implementation to report thread which owns parkBlocker.
>>
>> Testing: tier1..4,hs-tier5-svc
>
> src/java.base/share/classes/jdk/internal/vm/ThreadSnapshot.java line 52:
>
>> 50:
>> 51: // the owner of the blockerObject when the object is park blocker and is AQS
>> 52: private Thread parkBlockerOwner;
>
> Just wondering whether it makes sense to make the owner field part of the `ThreadBlocker` record?
The parkBlocker is a property of the thread. When the parkBlocker is an AbstractOwnableSynchronizer then the owner is a property of that park blocker type. So yes, in modelling terms it would be more accurate. In practical terms it doesn't matter as it's all encapsulated but there is likely more work in this area so it would be better to get it right.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27457#discussion_r2374672607
More information about the serviceability-dev
mailing list