On Fri, 6 Dec 2024 22:28:29 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

> This test fails after 
> [JDK-8338713](https://bugs.openjdk.org/browse/JDK-8338713) when using 
> JTREG_TEST_THREAD_FACTORY=Virtual. The test uses JVMTI StopThread on a thread 
> expecting it to be mounted. Before 
> [JDK-8338713](https://bugs.openjdk.org/browse/JDK-8338713) it would be 
> mounted because it was blocked on a syncrhonized, which resulted in the 
> thread being pinned. After 
> [JDK-8338713](https://bugs.openjdk.org/browse/JDK-8338713) this is no longer 
> the case and the virtual thread has unmounted. This causes JVMTI StopThread 
> to fail with JVMTI_ERROR_OPAQUE_FRAME because it only supports mounted 
> virtual threads.
> 
> Fixed by using the VThreadPinner class to make sure the virtual threads 
> remains pinned, and therefore mounted.
> 
> Testing:
> 
> - [x] Ran jdb tests locally in both virtual thread mode and platform thread 
> mode.
> - [x] tier1
> - [x] tier2 svc
> - [x] tier5 svc

> I think you and @AlanBateman didn't quite understand what I meant by:
> . . .
> The run1() method is called regardless of whether or not we are using 
> vthreads and VThreadPinner, so I don't think runPinned() is a good name for 
> it.

In fact, I understand it. I was thinking if renaming to something like 
`runPlatformOrPinnedVirtual()` would work. But there is no pressure from me on 
this as the method name will become kind of lengthy. :)

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

PR Comment: https://git.openjdk.org/jdk/pull/22620#issuecomment-2529588254

Reply via email to