Skip to content

Commit c9e87eb

Browse files
author
Alan Bateman
committed
8336254: Virtual thread implementation + test updates
Reviewed-by: sspitsyn, kevinw
1 parent ec9a7c2 commit c9e87eb

39 files changed

+2706
-1328
lines changed

make/test/JtregNativeHotspot.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ ifeq ($(call isTargetOs, windows), true)
871871
BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT
872872
BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libMonitorWithDeadObjectTest.c libTestPsig.c exeGetCreatedJavaVMs.c
873873
BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libnativeStack := java.base:libjvm
874+
BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libVThreadEventTest := java.base:libjvm
874875
else
875876
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libbootclssearch_agent += -lpthread
876877
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libsystemclssearch_agent += -lpthread
@@ -1509,6 +1510,7 @@ else
15091510
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libCompleteExit += -lpthread
15101511
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libMonitorWithDeadObjectTest += -lpthread
15111512
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack += -lpthread
1513+
BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libVThreadEventTest := java.base:libjvm
15121514
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeGetCreatedJavaVMs := -lpthread
15131515
BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exeGetCreatedJavaVMs := java.base:libjvm
15141516

src/java.base/share/classes/java/lang/System.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
import java.util.ResourceBundle;
6666
import java.util.Set;
6767
import java.util.WeakHashMap;
68-
import java.util.concurrent.Callable;
6968
import java.util.function.Supplier;
7069
import java.util.concurrent.ConcurrentHashMap;
7170
import java.util.stream.Stream;
@@ -2264,6 +2263,7 @@ private static class Out extends FileOutputStream {
22642263
super(fd);
22652264
}
22662265

2266+
@Override
22672267
public void write(int b) throws IOException {
22682268
boolean attempted = Blocker.begin();
22692269
try {
@@ -2677,14 +2677,6 @@ public Thread currentCarrierThread() {
26772677
return Thread.currentCarrierThread();
26782678
}
26792679

2680-
public <V> V executeOnCarrierThread(Callable<V> task) throws Exception {
2681-
if (Thread.currentThread() instanceof VirtualThread vthread) {
2682-
return vthread.executeOnCarrierThread(task);
2683-
} else {
2684-
return task.call();
2685-
}
2686-
}
2687-
26882680
public <T> T getCarrierThreadLocal(CarrierThreadLocal<T> local) {
26892681
return ((ThreadLocal<T>)local).getCarrierThreadLocal();
26902682
}

0 commit comments

Comments
 (0)