Package io.netty.buffer
Class PooledByteBufAllocator.PoolThreadLocalCache
- java.lang.Object
-
- io.netty.util.concurrent.FastThreadLocal<PoolArenasCache>
-
- io.netty.buffer.PooledByteBufAllocator.PoolThreadLocalCache
-
- Enclosing class:
- PooledByteBufAllocator
private final class PooledByteBufAllocator.PoolThreadLocalCache extends FastThreadLocal<PoolArenasCache>
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
useCacheForAllThreads
-
Constructor Summary
Constructors Constructor Description PoolThreadLocalCache(boolean useCacheForAllThreads)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PoolArenasCache
initialValue()
Returns the initial value for this thread-local variable.private <T> PoolArena<T>
leastUsedArena(PoolArena<T>[] arenas)
protected void
onRemoval(PoolArenasCache threadCache)
Invoked when this thread local variable is removed byFastThreadLocal.remove()
.
-
-
-
Method Detail
-
initialValue
protected PoolArenasCache initialValue()
Description copied from class:FastThreadLocal
Returns the initial value for this thread-local variable.- Overrides:
initialValue
in classFastThreadLocal<PoolArenasCache>
-
onRemoval
protected void onRemoval(PoolArenasCache threadCache)
Description copied from class:FastThreadLocal
Invoked 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:
onRemoval
in classFastThreadLocal<PoolArenasCache>
-
-