File tree Expand file tree Collapse file tree 3 files changed +17
-11
lines changed
Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -87,19 +87,10 @@ vmTestbase/nsk/jdi/ExceptionEvent/catchLocation/location002/TestDescription.java
8787vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 8285417 generic-all
8888
8989###
90- # The test first suspends a vthread and all the carriers and then it resumes the vthread expecting it
91- # to run to completion. In mainline it only works because the suspension step happens while the vthread is
92- # pinned to the carrier blocked on synchronized. So the carrier only actually suspends on the next unmount
93- # transition which in this test happens once the vthread has finished executing the expected code.
94-
90+ # Fails because resume of a virtual thread is not enough to allow the virtual thread
91+ # to make progress when all other threads are currently suspended.
9592vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002/TestDescription.java 8338713 generic-all
9693
97- ###
98- # The test sends a StopThread to a vthread expecting that is currently pinned to the carrier blocked on
99- # synchronized. Since the vthread is now unmounted StopThread returns JVMTI_ERROR_OPAQUE_FRAME error.
100-
101- vmTestbase/nsk/jdb/kill/kill001/kill001.java 8338714 generic-all
102-
10394###
10495# Fails on Windows because of additional memory allocation.
10596
Original file line number Diff line number Diff line change 2727import nsk .share .jpda .*;
2828import nsk .share .jdb .*;
2929import nsk .share .jdi .JDIThreadFactory ;
30+ import jdk .test .lib .thread .VThreadPinner ;
3031
3132import java .io .*;
3233import java .util .*;
@@ -152,6 +153,17 @@ void methodForException() {
152153 }
153154
154155 public void run () {
156+ boolean vthreadMode = "Virtual" .equals (System .getProperty ("test.thread.factory" ));
157+ if (vthreadMode ) {
158+ // JVMTI StopThread is only supported for mounted virtual threads. We need to
159+ // pin the virtual threads so they remain mounted.
160+ VThreadPinner .runPinned (() -> test ());
161+ } else {
162+ test ();
163+ }
164+ }
165+
166+ public void test () {
155167 // Concatenate strings in advance to avoid lambda calculations later
156168 String ThreadFinished = "Thread finished: " + this .name ;
157169 String CaughtExpected = "Thread " + this .name + " caught expected async exception: " + expectedException ;
Original file line number Diff line number Diff line change @@ -137,6 +137,9 @@ private String[] makeJdbCmdLine (String classToExecute) {
137137 /* Some tests need more carrier threads than the default provided. */
138138 args .add ("-R-Djdk.virtualThreadScheduler.parallelism=15" );
139139 }
140+ /* Some jdb tests need java.library.path setup for native libraries. */
141+ String libpath = System .getProperty ("java.library.path" );
142+ args .add ("-R-Djava.library.path=" + libpath );
140143 }
141144
142145 args .addAll (argumentHandler .enwrapJavaOptions (argumentHandler .getJavaOptions ()));
You can’t perform that action at this time.
0 commit comments