< prev index next >

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

Print this page

  69 import java.util.stream.Stream;
  70 
  71 import jdk.internal.misc.CarrierThreadLocal;
  72 import jdk.internal.misc.Unsafe;
  73 import jdk.internal.util.StaticProperty;
  74 import jdk.internal.module.ModuleBootstrap;
  75 import jdk.internal.module.ServicesCatalog;
  76 import jdk.internal.reflect.CallerSensitive;
  77 import jdk.internal.reflect.Reflection;
  78 import jdk.internal.access.JavaLangAccess;
  79 import jdk.internal.access.SharedSecrets;
  80 import jdk.internal.misc.VM;
  81 import jdk.internal.logger.LoggerFinderLoader;
  82 import jdk.internal.logger.LazyLoggers;
  83 import jdk.internal.logger.LocalizedLoggerWrapper;
  84 import jdk.internal.util.SystemProps;
  85 import jdk.internal.vm.Continuation;
  86 import jdk.internal.vm.ContinuationScope;
  87 import jdk.internal.vm.StackableScope;
  88 import jdk.internal.vm.ThreadContainer;

  89 import jdk.internal.vm.annotation.IntrinsicCandidate;
  90 import jdk.internal.vm.annotation.Stable;
  91 import jdk.internal.vm.annotation.ChangesCurrentThread;
  92 import sun.nio.fs.DefaultFileSystemProvider;
  93 import sun.reflect.annotation.AnnotationType;
  94 import sun.nio.ch.Interruptible;
  95 import sun.nio.cs.UTF_8;
  96 import sun.security.util.SecurityConstants;
  97 
  98 /**
  99  * The {@code System} class contains several useful class fields
 100  * and methods. It cannot be instantiated.
 101  *
 102  * Among the facilities provided by the {@code System} class
 103  * are standard input, standard output, and error output streams;
 104  * access to externally defined properties and environment
 105  * variables; a means of loading files and libraries; and a utility
 106  * method for quickly copying a portion of an array.
 107  *
 108  * @since   1.0

2561                     return task.call();
2562                 }
2563             }
2564 
2565             public <T> T getCarrierThreadLocal(CarrierThreadLocal<T> local) {
2566                 return ((ThreadLocal<T>)local).getCarrierThreadLocal();
2567             }
2568 
2569             public <T> void setCarrierThreadLocal(CarrierThreadLocal<T> local, T value) {
2570                 ((ThreadLocal<T>)local).setCarrierThreadLocal(value);
2571             }
2572 
2573             public void removeCarrierThreadLocal(CarrierThreadLocal<?> local) {
2574                 ((ThreadLocal<?>)local).removeCarrierThreadLocal();
2575             }
2576 
2577             public boolean isCarrierThreadLocalPresent(CarrierThreadLocal<?> local) {
2578                 return ((ThreadLocal<?>)local).isCarrierThreadLocalPresent();
2579             }
2580 
2581             public Object[] extentLocalCache() {
2582                 return Thread.extentLocalCache();
2583             }
2584 
2585             public void setExtentLocalCache(Object[] cache) {
2586                 Thread.setExtentLocalCache(cache);
2587             }
2588 
2589             public Object extentLocalBindings() {
2590                 return Thread.extentLocalBindings();
2591             }
2592 
2593             public void setExtentLocalBindings(Object bindings) {
2594                 Thread.setExtentLocalBindings(bindings);









2595             }
2596 
2597             public Continuation getContinuation(Thread thread) {
2598                 return thread.getContinuation();
2599             }
2600 
2601             public void setContinuation(Thread thread, Continuation continuation) {
2602                 thread.setContinuation(continuation);
2603             }
2604 
2605             public ContinuationScope virtualThreadContinuationScope() {
2606                 return VirtualThread.continuationScope();
2607             }
2608 
2609             public void parkVirtualThread() {
2610                 Thread thread = Thread.currentThread();
2611                 if (thread instanceof BaseVirtualThread vthread) {
2612                     vthread.park();
2613                 } else {
2614                     throw new WrongThreadException();

  69 import java.util.stream.Stream;
  70 
  71 import jdk.internal.misc.CarrierThreadLocal;
  72 import jdk.internal.misc.Unsafe;
  73 import jdk.internal.util.StaticProperty;
  74 import jdk.internal.module.ModuleBootstrap;
  75 import jdk.internal.module.ServicesCatalog;
  76 import jdk.internal.reflect.CallerSensitive;
  77 import jdk.internal.reflect.Reflection;
  78 import jdk.internal.access.JavaLangAccess;
  79 import jdk.internal.access.SharedSecrets;
  80 import jdk.internal.misc.VM;
  81 import jdk.internal.logger.LoggerFinderLoader;
  82 import jdk.internal.logger.LazyLoggers;
  83 import jdk.internal.logger.LocalizedLoggerWrapper;
  84 import jdk.internal.util.SystemProps;
  85 import jdk.internal.vm.Continuation;
  86 import jdk.internal.vm.ContinuationScope;
  87 import jdk.internal.vm.StackableScope;
  88 import jdk.internal.vm.ThreadContainer;
  89 import jdk.internal.vm.annotation.ForceInline;
  90 import jdk.internal.vm.annotation.IntrinsicCandidate;
  91 import jdk.internal.vm.annotation.Stable;
  92 import jdk.internal.vm.annotation.ChangesCurrentThread;
  93 import sun.nio.fs.DefaultFileSystemProvider;
  94 import sun.reflect.annotation.AnnotationType;
  95 import sun.nio.ch.Interruptible;
  96 import sun.nio.cs.UTF_8;
  97 import sun.security.util.SecurityConstants;
  98 
  99 /**
 100  * The {@code System} class contains several useful class fields
 101  * and methods. It cannot be instantiated.
 102  *
 103  * Among the facilities provided by the {@code System} class
 104  * are standard input, standard output, and error output streams;
 105  * access to externally defined properties and environment
 106  * variables; a means of loading files and libraries; and a utility
 107  * method for quickly copying a portion of an array.
 108  *
 109  * @since   1.0

2562                     return task.call();
2563                 }
2564             }
2565 
2566             public <T> T getCarrierThreadLocal(CarrierThreadLocal<T> local) {
2567                 return ((ThreadLocal<T>)local).getCarrierThreadLocal();
2568             }
2569 
2570             public <T> void setCarrierThreadLocal(CarrierThreadLocal<T> local, T value) {
2571                 ((ThreadLocal<T>)local).setCarrierThreadLocal(value);
2572             }
2573 
2574             public void removeCarrierThreadLocal(CarrierThreadLocal<?> local) {
2575                 ((ThreadLocal<?>)local).removeCarrierThreadLocal();
2576             }
2577 
2578             public boolean isCarrierThreadLocalPresent(CarrierThreadLocal<?> local) {
2579                 return ((ThreadLocal<?>)local).isCarrierThreadLocalPresent();
2580             }
2581 
2582             public Object[] scopedValueCache() {
2583                 return Thread.scopedValueCache();
2584             }
2585 
2586             public void setScopedValueCache(Object[] cache) {
2587                 Thread.setScopedValueCache(cache);
2588             }
2589 
2590             public Object scopedValueBindings() {
2591                 return Thread.scopedValueBindings();
2592             }
2593 
2594             public Object findScopedValueBindings() {
2595                 return Thread.findScopedValueBindings();
2596             }
2597 
2598             public void setScopedValueBindings(Object bindings) {
2599                 Thread.setScopedValueBindings(bindings);
2600             }
2601 
2602             @ForceInline
2603             public void ensureMaterializedForStackWalk(Object value) {
2604                 Thread.ensureMaterializedForStackWalk(value);
2605             }
2606 
2607             public Continuation getContinuation(Thread thread) {
2608                 return thread.getContinuation();
2609             }
2610 
2611             public void setContinuation(Thread thread, Continuation continuation) {
2612                 thread.setContinuation(continuation);
2613             }
2614 
2615             public ContinuationScope virtualThreadContinuationScope() {
2616                 return VirtualThread.continuationScope();
2617             }
2618 
2619             public void parkVirtualThread() {
2620                 Thread thread = Thread.currentThread();
2621                 if (thread instanceof BaseVirtualThread vthread) {
2622                     vthread.park();
2623                 } else {
2624                     throw new WrongThreadException();
< prev index next >