Need to implement support of virtual threds in JVMTI StopThread.
The spec update is:
diff --git a/src/hotspot/share/prims/jvmti.xml b/src/hotspot/share/prims/jvmti.xml
index 456876fbcb9..da93a5fcb68 100644
--- a/src/hotspot/share/prims/jvmti.xml
+++ b/src/hotspot/share/prims/jvmti.xml
@@ -1892,7 +1892,7 @@ jvmtiEnv *jvmti;
<function id="StopThread" num="7">
<synopsis>Stop Thread</synopsis>
<description>
- Send the specified asynchronous exception to the specified platform thread.
+ Send the specified asynchronous exception to the specified thread.
</description>
<origin>jvmdi</origin>
<capabilities>
@@ -1903,8 +1903,10 @@ jvmtiEnv *jvmti;
<jthread impl="noconvert"/>
<description>
The thread to stop.
- The <code>thread</code> may not be a virtual thread. Otherwise, the error code
- <errorlink id="JVMTI_ERROR_UNSUPPORTED_OPERATION"></errorlink> will be returned.
+ The <functionlink id="StopThread"></functionlink> function may be used to send
+ an asynchronous exception to a virtual thread when it is suspended at an event.
+ An implementation may support sending an asynchronous exception to a suspended
+ virtual thread in other cases.
</description>
</param>
<param id="exception">
@@ -1915,8 +1917,12 @@ jvmtiEnv *jvmti;
</param>
</parameters>
<errors>
- <error id="JVMTI_ERROR_UNSUPPORTED_OPERATION">
- <paramlink id="thread"/> is a virtual thread.
+ <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
+ Thread is a virtual thread and was not suspended and was not the current thread.
+ </error>
+ <error id="JVMTI_ERROR_OPAQUE_FRAME">
+ The thread is a suspended virtual thread and the implementation was unable
+ to throw an asynchronous exception from this frame.
</error>
</errors>
</function>
@@ -11974,7 +11980,8 @@ myInit() {
There are no Java programming language or JNI stack frames at the specified depth.
</errorid>
<errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32">
- Information about the frame is not available (e.g. for native frames).
+ Information about the frame is not available (e.g. for native frames),
+ or the frame is not suitable for the requested operation.
</errorid>
<errorid id="JVMTI_ERROR_DUPLICATE" num="40">
Item already set.
The spec update is:
diff --git a/src/hotspot/share/prims/jvmti.xml b/src/hotspot/share/prims/jvmti.xml
index 456876fbcb9..da93a5fcb68 100644
--- a/src/hotspot/share/prims/jvmti.xml
+++ b/src/hotspot/share/prims/jvmti.xml
@@ -1892,7 +1892,7 @@ jvmtiEnv *jvmti;
<function id="StopThread" num="7">
<synopsis>Stop Thread</synopsis>
<description>
- Send the specified asynchronous exception to the specified platform thread.
+ Send the specified asynchronous exception to the specified thread.
</description>
<origin>jvmdi</origin>
<capabilities>
@@ -1903,8 +1903,10 @@ jvmtiEnv *jvmti;
<jthread impl="noconvert"/>
<description>
The thread to stop.
- The <code>thread</code> may not be a virtual thread. Otherwise, the error code
- <errorlink id="JVMTI_ERROR_UNSUPPORTED_OPERATION"></errorlink> will be returned.
+ The <functionlink id="StopThread"></functionlink> function may be used to send
+ an asynchronous exception to a virtual thread when it is suspended at an event.
+ An implementation may support sending an asynchronous exception to a suspended
+ virtual thread in other cases.
</description>
</param>
<param id="exception">
@@ -1915,8 +1917,12 @@ jvmtiEnv *jvmti;
</param>
</parameters>
<errors>
- <error id="JVMTI_ERROR_UNSUPPORTED_OPERATION">
- <paramlink id="thread"/> is a virtual thread.
+ <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
+ Thread is a virtual thread and was not suspended and was not the current thread.
+ </error>
+ <error id="JVMTI_ERROR_OPAQUE_FRAME">
+ The thread is a suspended virtual thread and the implementation was unable
+ to throw an asynchronous exception from this frame.
</error>
</errors>
</function>
@@ -11974,7 +11980,8 @@ myInit() {
There are no Java programming language or JNI stack frames at the specified depth.
</errorid>
<errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32">
- Information about the frame is not available (e.g. for native frames).
+ Information about the frame is not available (e.g. for native frames),
+ or the frame is not suitable for the requested operation.
</errorid>
<errorid id="JVMTI_ERROR_DUPLICATE" num="40">
Item already set.
- csr for
-
JDK-8306434 add support of virtual threads to JVMTI StopThread
-
- Closed
-
- relates to
-
JDK-8306467 Fix nsk/jdb/kill/kill001 to work with new JVMTI StopThread support for virtual threads.
-
- Resolved
-
-
JDK-8307968 serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java timed out
-
- Resolved
-
-
JDK-8306471 Add virtual threads support to JDWP ThreadReference.Stop and JDI ThreadReference.stop()
-
- Resolved
-
-
JDK-8306324 StopThread results in thread being marked as interrupted, leading to unexpected InterruptedException
-
- Open
-
(2 links to)