public class SttlValue
值, 有作用域的可传递的 ThreadLocal 中的值 ScopedTransferableThreadLocal.endScope() 可能随时随地调用, 也就是说 SttlValue 随时可能被删除, 但可能某个线程调用了 SttlInterceptor.intercept(回调), 但此时回调还没触发, 也就是旧的 ScopedTransferableThreadLocal 对象还未恢复, 等恢复后引用的 SttlValue 却应该被删掉, 因此添加 deleted 属性来做是否已删除的判断
| 构造器和说明 |
|---|
SttlValue(java.lang.Object value)
值, 有作用域的可传递的 ThreadLocal 中的值
ScopedTransferableThreadLocal.endScope() 可能随时随地调用, 也就是说 SttlValue 随时可能被删除, 但可能某个线程调用了 SttlInterceptor.intercept(回调), 但此时回调还没触发, 也就是旧的 ScopedTransferableThreadLocal 对象还未恢复, 等恢复后引用的 SttlValue 却应该被删掉, 因此添加 deleted 属性来做是否已删除的判断
|
SttlValue()
值, 有作用域的可传递的 ThreadLocal 中的值
ScopedTransferableThreadLocal.endScope() 可能随时随地调用, 也就是说 SttlValue 随时可能被删除, 但可能某个线程调用了 SttlInterceptor.intercept(回调), 但此时回调还没触发, 也就是旧的 ScopedTransferableThreadLocal 对象还未恢复, 等恢复后引用的 SttlValue 却应该被删掉, 因此添加 deleted 属性来做是否已删除的判断
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addThread(java.lang.Thread t)
添加被传递的线程
|
boolean |
getDeleted()
是否已删除
|
java.lang.Object |
getValue() |
void |
pollEachThread(kotlin.jvm.functions.Function1<? super java.lang.Thread,kotlin.Unit> action)
逐个出队被传递线程, 并访问
|
void |
removeThread(java.lang.Thread t)
删除被传递线程
|
void |
setDeleted(boolean p)
是否已删除
|
void |
setValue(java.lang.Object p) |
public SttlValue(java.lang.Object value)
值, 有作用域的可传递的 ThreadLocal 中的值 ScopedTransferableThreadLocal.endScope() 可能随时随地调用, 也就是说 SttlValue 随时可能被删除, 但可能某个线程调用了 SttlInterceptor.intercept(回调), 但此时回调还没触发, 也就是旧的 ScopedTransferableThreadLocal 对象还未恢复, 等恢复后引用的 SttlValue 却应该被删掉, 因此添加 deleted 属性来做是否已删除的判断
public SttlValue()
值, 有作用域的可传递的 ThreadLocal 中的值 ScopedTransferableThreadLocal.endScope() 可能随时随地调用, 也就是说 SttlValue 随时可能被删除, 但可能某个线程调用了 SttlInterceptor.intercept(回调), 但此时回调还没触发, 也就是旧的 ScopedTransferableThreadLocal 对象还未恢复, 等恢复后引用的 SttlValue 却应该被删掉, 因此添加 deleted 属性来做是否已删除的判断
public boolean getDeleted()
是否已删除
public void setDeleted(boolean p)
是否已删除
public void addThread(java.lang.Thread t)
添加被传递的线程
public void removeThread(java.lang.Thread t)
删除被传递线程
public void pollEachThread(kotlin.jvm.functions.Function1<? super java.lang.Thread,kotlin.Unit> action)
逐个出队被传递线程, 并访问
public java.lang.Object getValue()
public void setValue(java.lang.Object p)