< prev index next >

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

Print this page
*** 52,11 ***
  import java.util.Map;
  import java.util.Objects;
  import java.util.Properties;
  import java.util.ResourceBundle;
  import java.util.Set;
- import java.util.concurrent.Executor;
  import java.util.function.Supplier;
  import java.util.concurrent.ConcurrentHashMap;
  import java.util.stream.Stream;
  
  import jdk.internal.javac.Restricted;
--- 52,10 ---

*** 2272,10 ***
--- 2271,18 ---
  
              public Object scopedValueBindings() {
                  return Thread.scopedValueBindings();
              }
  
+             public long nativeThreadID(Thread thread) {
+                 return thread.nativeThreadID();
+             }
+ 
+             public void setThreadNativeID(long id) {
+                 Thread.currentThread().setNativeThreadID(id);
+             }
+ 
              public Continuation getContinuation(Thread thread) {
                  return thread.getContinuation();
              }
  
              public void setContinuation(Thread thread, Continuation continuation) {

*** 2306,18 ***
  
              public void unparkVirtualThread(Thread thread) {
                  if (thread instanceof BaseVirtualThread vthread) {
                      vthread.unpark();
                  } else {
!                     throw new WrongThreadException();
                  }
              }
  
!             public Executor virtualThreadDefaultScheduler() {
                  return VirtualThread.defaultScheduler();
              }
  
              public StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
                                                        ContinuationScope contScope,
                                                        Continuation continuation) {
                  return StackWalker.newInstance(options, null, contScope, continuation);
              }
--- 2313,30 ---
  
              public void unparkVirtualThread(Thread thread) {
                  if (thread instanceof BaseVirtualThread vthread) {
                      vthread.unpark();
                  } else {
!                     throw new IllegalArgumentException();
                  }
              }
  
!             public Thread.VirtualThreadScheduler defaultVirtualThreadScheduler() {
                  return VirtualThread.defaultScheduler();
              }
  
+             public boolean isCustomDefaultVirtualThreadScheduler() {
+                 return VirtualThread.isCustomDefaultScheduler();
+             }
+ 
+             public Thread.VirtualThreadScheduler virtualThreadScheduler(Thread thread) {
+                 if (thread instanceof VirtualThread vthread) {
+                     return vthread.scheduler(true);
+                 } else {
+                     throw new IllegalArgumentException();
+                 }
+             }
+ 
              public StackWalker newStackWalkerInstance(Set<StackWalker.Option> options,
                                                        ContinuationScope contScope,
                                                        Continuation continuation) {
                  return StackWalker.newInstance(options, null, contScope, continuation);
              }
< prev index next >