Package io.netty.buffer
Class PooledByteBufAllocator.PoolThreadLocalCache
- java.lang.Object
-
- io.netty.util.concurrent.FastThreadLocal<PoolThreadCache>
-
- io.netty.buffer.PooledByteBufAllocator.PoolThreadLocalCache
-
- Enclosing class:
- PooledByteBufAllocator
final class PooledByteBufAllocator.PoolThreadLocalCache extends FastThreadLocal<PoolThreadCache>
-
-
Field Summary
Fields Modifier and Type Field Description private booleanuseCacheForAllThreads
-
Constructor Summary
Constructors Constructor Description PoolThreadLocalCache(boolean useCacheForAllThreads)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PoolThreadCacheinitialValue()Returns the initial value for this thread-local variable.private <T> PoolArena<T>leastUsedArena(PoolArena<T>[] arenas)protected voidonRemoval(PoolThreadCache threadCache)Invoked when this thread local variable is removed byFastThreadLocal.remove().
-
-
-
Method Detail
-
initialValue
protected PoolThreadCache initialValue()
Description copied from class:FastThreadLocalReturns the initial value for this thread-local variable.- Overrides:
initialValuein classFastThreadLocal<PoolThreadCache>
-
onRemoval
protected void onRemoval(PoolThreadCache threadCache)
Description copied from class:FastThreadLocalInvoked when this thread local variable is removed byFastThreadLocal.remove(). Be aware thatFastThreadLocal.remove()is not guaranteed to be called when the `Thread` completes which means you can not depend on this for cleanup of the resources in the case of `Thread` completion.- Overrides:
onRemovalin classFastThreadLocal<PoolThreadCache>
-
-