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.