📜  Java.lang.InheritableThreadLocal类

📅  最后修改于: 2020-11-15 03:00:54             🧑  作者: Mango


介绍

java.lang.InheritableThreadLocal类将ThreadLocal扩展为提供从父线程到子线程的值的继承:创建子线程时,子级将接收父级具有值的所有可继承线程局部变量的初始值。

类声明

以下是java.lang.InheritableThreadLocal类的声明-

public class InheritableThreadLocal
   extends ThreadLocal

类的构造函数

S.N. Constructor & Description
1

public class InheritableThreadLocalextends ThreadLocal

This is the Single Constructor.

类方法

S.N. Method & Description
1

protected T childValue(T parentValue)

This method computes the child’s initial value for this inheritable thread-local variable as a function of the parent’s value at the time the child thread is created.

方法继承

此类从以下类继承方法-

  • java.lang.ThreadLocal
  • java.lang.Object