< prev index next >

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

Print this page

2569             public ThreadContainer threadContainer(Thread thread) {
2570                 return thread.threadContainer();
2571             }
2572 
2573             public void start(Thread thread, ThreadContainer container) {
2574                 thread.start(container);
2575             }
2576 
2577             public StackableScope headStackableScope(Thread thread) {
2578                 return thread.headStackableScopes();
2579             }
2580 
2581             public void setHeadStackableScope(StackableScope scope) {
2582                 Thread.setHeadStackableScope(scope);
2583             }
2584 
2585             public Thread currentCarrierThread() {
2586                 return Thread.currentCarrierThread();
2587             }
2588 
2589             public <V> V executeOnCarrierThread(Callable<V> task) throws Exception {
2590                 if (Thread.currentThread() instanceof VirtualThread vthread) {
2591                     return vthread.executeOnCarrierThread(task);
2592                 } else {
2593                     return task.call();
2594                 }
2595             }
2596 
2597             public <T> T getCarrierThreadLocal(CarrierThreadLocal<T> local) {
2598                 return ((ThreadLocal<T>)local).getCarrierThreadLocal();
2599             }
2600 
2601             public <T> void setCarrierThreadLocal(CarrierThreadLocal<T> local, T value) {
2602                 ((ThreadLocal<T>)local).setCarrierThreadLocal(value);
2603             }
2604 
2605             public void removeCarrierThreadLocal(CarrierThreadLocal<?> local) {
2606                 ((ThreadLocal<?>)local).removeCarrierThreadLocal();
2607             }
2608 
2609             public boolean isCarrierThreadLocalPresent(CarrierThreadLocal<?> local) {
2610                 return ((ThreadLocal<?>)local).isCarrierThreadLocalPresent();
2611             }
2612 
2613             public Object[] scopedValueCache() {
2614                 return Thread.scopedValueCache();
2615             }
2616 

2569             public ThreadContainer threadContainer(Thread thread) {
2570                 return thread.threadContainer();
2571             }
2572 
2573             public void start(Thread thread, ThreadContainer container) {
2574                 thread.start(container);
2575             }
2576 
2577             public StackableScope headStackableScope(Thread thread) {
2578                 return thread.headStackableScopes();
2579             }
2580 
2581             public void setHeadStackableScope(StackableScope scope) {
2582                 Thread.setHeadStackableScope(scope);
2583             }
2584 
2585             public Thread currentCarrierThread() {
2586                 return Thread.currentCarrierThread();
2587             }
2588 








2589             public <T> T getCarrierThreadLocal(CarrierThreadLocal<T> local) {
2590                 return ((ThreadLocal<T>)local).getCarrierThreadLocal();
2591             }
2592 
2593             public <T> void setCarrierThreadLocal(CarrierThreadLocal<T> local, T value) {
2594                 ((ThreadLocal<T>)local).setCarrierThreadLocal(value);
2595             }
2596 
2597             public void removeCarrierThreadLocal(CarrierThreadLocal<?> local) {
2598                 ((ThreadLocal<?>)local).removeCarrierThreadLocal();
2599             }
2600 
2601             public boolean isCarrierThreadLocalPresent(CarrierThreadLocal<?> local) {
2602                 return ((ThreadLocal<?>)local).isCarrierThreadLocalPresent();
2603             }
2604 
2605             public Object[] scopedValueCache() {
2606                 return Thread.scopedValueCache();
2607             }
2608 
< prev index next >