Class FastThreadLocal<T>
java.lang.Object
org.glowroot.agent.plugin.api.util.FastThreadLocal<T>
Wrapper that implements optimized
ThreadLocal
access pattern ideal for heavily used
ThreadLocals.
It is faster to use a mutable holder object and always perform ThreadLocal.get() and never use
ThreadLocal.set(), because the value is more likely to be found in the ThreadLocalMap direct hash
slot and avoid the slow path ThreadLocalMap.getEntryAfterMiss().
Important: this thread local will live in ThreadLocalMap forever, so use with care.-
Constructor Details
-
FastThreadLocal
public FastThreadLocal()
-
-
Method Details
-
get
-
set
-
getHolder
-
initialValue
-