public class AttachmentThread
extends io.netty.util.concurrent.FastThreadLocalThread
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
static int |
MAXIMUM_CAPACITY |
static Object |
NOT_FOUND |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
AttachmentThread() |
AttachmentThread(Runnable runnable) |
AttachmentThread(Runnable runnable,
String name) |
AttachmentThread(String name) |
AttachmentThread(ThreadGroup threadGroup,
Runnable runnable,
String name) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(int index)
获取线程变量
|
<T> T |
getOrUpdate(int index,
Supplier<T> producer) |
void |
put(int index,
Object value)
存储线程变量
|
setThreadLocalMap, threadLocalMap, willCleanupFastThreadLocals, willCleanupFastThreadLocalsactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic static final Object NOT_FOUND
public static final int MAXIMUM_CAPACITY
public AttachmentThread()
public AttachmentThread(Runnable runnable)
public AttachmentThread(String name)
public AttachmentThread(ThreadGroup threadGroup, Runnable runnable, String name)
public void put(int index,
Object value)
index - 需要从AttachmentThreadUtils.nextVarIndex()获取到public <T> T get(int index)
index - 需要从 AttachmentThreadUtils.nextVarIndex()获取到public <T> T getOrUpdate(int index,
Supplier<T> producer)
Copyright © 2019. All rights reserved.