< prev index next >

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

Print this page
*** 2218,10 ***
--- 2218,26 ---
  
              public Thread currentCarrierThread() {
                  return Thread.currentCarrierThread();
              }
  
+             public Thread getCarrierThread(Thread thread) {
+                 if (thread instanceof VirtualThread vthread) {
+                     return vthread.carrierThread();
+                 } else {
+                     throw new UnsupportedOperationException();
+                 }
+             }
+ 
+             public int getInternalState(Thread thread) {
+                 if (thread instanceof VirtualThread vthread) {
+                     return vthread.state();
+                 } else {
+                     throw new UnsupportedOperationException();
+                 }
+             }
+ 
              public <T> T getCarrierThreadLocal(CarrierThreadLocal<T> local) {
                  return ((ThreadLocal<T>)local).getCarrierThreadLocal();
              }
  
              public <T> void setCarrierThreadLocal(CarrierThreadLocal<T> local, T value) {
< prev index next >