RFR: 8356222: Thread.print command reports waiting on the Class initialization monitor for both carrier and virtual threads

Alan Bateman alanb at openjdk.org
Sat May 24 08:10:56 UTC 2025


On Wed, 21 May 2025 20:35:33 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> The change fixes "Thread.print" diagnostic command when mounted virtual thread is waiting on the class initialization monitor.
> 
> Testing: new test, tier1 sanity run

test/hotspot/jtreg/serviceability/dcmd/thread/ClassInitMonitorVThread.java line 71:

> 69:             Thread vthread2 = Thread.ofVirtual().name("Loader2").start(new Loader(loaderReady));
> 70:             loaderReady.await();
> 71:             Thread.sleep(100);

How reliable is this? With a debug build and -Xcomp/other options, then this might not long enough to observe "Loader 2" waiting for the class initializer.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25367#discussion_r2105754084


More information about the serviceability-dev mailing list