RFR: 8306467: Fix nsk/jdb/kill/kill001 to work with new JVMTI StopThread support for virtual threads.

Alex Menkov amenkov at openjdk.org
Sat May 13 00:54:56 UTC 2023


On Sat, 13 May 2023 00:15:00 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> The debugger side checks for the proper notKilled value (it should be 0). So the test still passes even though it never confirmed that the correct async exception was thrown and caught. It just knows that the thread did not exit cleanly. Probably instead of tracking `notKilled`, the test should track `killed` and only increment when the correct exception is actually caught.

I think this will make the test more reliable.

> I'm not so sure the sleep is even necessary since we block in the synchronized indefinitely until the async exception is thrown. I think just a simple statement at the start of the try block is good enough. Maybe a println(). But this is somewhat fragile because we need to make sure there is no code between the synchronized and the try, so we probably need to move the synchronized to within the try also.

looks like we just need to move synchronized (or some other code to force vthread to be mounted) to inside the try and remove Thread.sleep, no other statements are needed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13967#discussion_r1192889054


More information about the serviceability-dev mailing list