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