java.lang.Object
com.tlcsdm.core.concurrent.DetachedThreadLocal<T>
- 所有已实现的接口:
Runnable
A detached local that allows for explicit control of setting and removing values from a thread-local context.
Instances of this class are non-blocking and fully thread safe.- 作者:
- unknowIfGuestInDream
-
嵌套类概要
嵌套类 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidclear()voidclearAll()Clears all thread local references for all threads.voidget()protected TinheritValue(T value) protected TinitialValue(Thread thread) voidrun()void
-
字段详细资料
-
map
-
-
构造器详细资料
-
DetachedThreadLocal
-
-
方法详细资料
-
get
-
getIfPresent
-
set
-
clear
public void clear() -
clearAll
public void clearAll()Clears all thread local references for all threads. -
pushTo
- 参数:
thread- The thread to which this thread's thread local value should be pushed.- 返回:
- The value being set.
-
fetchFrom
- 参数:
thread- The thread from which the thread thread local value should be fetched.- 返回:
- The value being set.
-
get
- 参数:
thread- The thread for which to set a thread-local value.- 返回:
- The value accociated with this thread.
-
define
- 参数:
thread- The thread for which to set a thread-local value.value- The value to set.
-
initialValue
- 参数:
thread- The thread for which an initial value is created.- 返回:
- The initial value for any thread local. If no default is set, the default value is
null.
-
inheritValue
- 参数:
value- The value that is inherited.- 返回:
- The inherited value.
-
getBackingMap
- 返回:
- The weak map that backs this detached thread local.
-
run
public void run()
-