RFR: 8334215: serviceability/dcmd/thread/PrintMountedVirtualThread.java failing with JTREG_TEST_THREAD_FACTORY=Virtual

Alan Bateman alanb at openjdk.org
Mon Jun 17 13:03:12 UTC 2024


On Mon, 17 Jun 2024 12:37:01 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Follow up to https://github.com/openjdk/jdk/pull/19482 that was causing issues when the PrintMountedVirtualTest.java was
>> running with `JTREG_TEST_THREAD_FACTORY=Virtual` in the loom repo. 
>> 
>> - Fixes issues where the test observes the thread during transitions.
>> - Fixes a potential issue in the test where CountDownLatch.countDown unparks the main (virtual) thread and the main thread observes the dummy thread is transition .
>
> test/hotspot/jtreg/serviceability/dcmd/thread/PrintMountedVirtualThread.java line 43:
> 
>> 41:     public void run(CommandExecutor executor) throws InterruptedException {
>> 42:         var shouldFinish = new AtomicBoolean(false);
>> 43:         var started = new AtomicBoolean();
> 
> Not sure how this change make things better? Why would we want to sleep and poll rather than park until signalled?

`started.countDown()` is replaced with `started.set(true)` to remove the possibility that "Dummy Vthread" unmounts here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19744#discussion_r1642778316


More information about the serviceability-dev mailing list