public class InheritableThreadLocal<T> extends ThreadLocal<T>
当维护变量中的每个线程属性(例如,用户ID,事务ID)必须自动发送到创建的任何子线程时,可以使用可继承的线程局部变量。
ThreadLocal
Constructor and Description |
---|
InheritableThreadLocal() |
Modifier and Type | Method and Description |
---|---|
protected T |
childValue(T parentValue)
在子线程创建时,根据父值的值计算该可继承线程局部变量的子级初始值。
|
get, initialValue, remove, set, withInitial
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.