On Tue, 23 Sep 2025 20:22:31 GMT, Alex Menkov <amen...@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/ThreadDumper.java line 208:

> 206:                 Object parkBlocker = snapshot.parkBlocker();
> 207:                 if (parkBlocker != null) {
> 208:                     String suffix = (snapshot.parkBlockerOwner() != null)

This was `if (snapshot.parkBlockerOwner() instanceof Thread owner)` in the 
original prototype. It avoids the null check and allow L209 to use 
owner.threadId(). It also is consistent with the other use of pattern matching 
with instanceof in this code.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27457#discussion_r2374569271

Reply via email to