Commit 414eb6b 1 parent dc71e8c commit 414eb6b Copy full SHA for 414eb6b
File tree 3 files changed +17
-11
lines changed
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
87
87
vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 8285417 generic-all
88
88
89
89
###
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.
95
92
vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002/TestDescription.java 8338713 generic-all
96
93
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
-
103
94
###
104
95
# Fails on Windows because of additional memory allocation.
105
96
Original file line number Diff line number Diff line change 27
27
import nsk .share .jpda .*;
28
28
import nsk .share .jdb .*;
29
29
import nsk .share .jdi .JDIThreadFactory ;
30
+ import jdk .test .lib .thread .VThreadPinner ;
30
31
31
32
import java .io .*;
32
33
import java .util .*;
@@ -152,6 +153,17 @@ void methodForException() {
152
153
}
153
154
154
155
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 () {
155
167
// Concatenate strings in advance to avoid lambda calculations later
156
168
String ThreadFinished = "Thread finished: " + this .name ;
157
169
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) {
137
137
/* Some tests need more carrier threads than the default provided. */
138
138
args .add ("-R-Djdk.virtualThreadScheduler.parallelism=15" );
139
139
}
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 );
140
143
}
141
144
142
145
args .addAll (argumentHandler .enwrapJavaOptions (argumentHandler .getJavaOptions ()));
You can’t perform that action at this time.
0 commit comments