Class FastThreadLocalThread
java.lang.Object
java.lang.Thread
io.netty.util.concurrent.FastThreadLocalThread
- All Implemented Interfaces:
Runnable
A special
Thread that provides fast access to FastThreadLocal variables.-
Nested Class Summary
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionFastThreadLocalThread(Runnable target) FastThreadLocalThread(Runnable target, String name) FastThreadLocalThread(String name) FastThreadLocalThread(ThreadGroup group, Runnable target) FastThreadLocalThread(ThreadGroup group, Runnable target, String name) FastThreadLocalThread(ThreadGroup group, Runnable target, String name, long stackSize) FastThreadLocalThread(ThreadGroup group, String name) -
Method Summary
Modifier and TypeMethodDescriptionbooleanQuery whether this thread is allowed to perform blocking calls or not.final voidsetThreadLocalMap(InternalThreadLocalMap threadLocalMap) Sets the internal data structure that keeps the thread-local variables bound to this thread.final InternalThreadLocalMapReturns the internal data structure that keeps the thread-local variables bound to this thread.booleanstatic booleanwillCleanupFastThreadLocals(Thread thread) Methods inherited from class Thread
activeCount, 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, yield
-
Constructor Details
-
FastThreadLocalThread
public FastThreadLocalThread() -
FastThreadLocalThread
-
FastThreadLocalThread
-
FastThreadLocalThread
-
FastThreadLocalThread
-
FastThreadLocalThread
-
FastThreadLocalThread
-
FastThreadLocalThread
-
-
Method Details
-
threadLocalMap
Returns the internal data structure that keeps the thread-local variables bound to this thread. Note that this method is for internal use only, and thus is subject to change at any time. -
setThreadLocalMap
Sets the internal data structure that keeps the thread-local variables bound to this thread. Note that this method is for internal use only, and thus is subject to change at any time. -
willCleanupFastThreadLocals
public boolean willCleanupFastThreadLocals() -
willCleanupFastThreadLocals
-
permitBlockingCalls
public boolean permitBlockingCalls()Query whether this thread is allowed to perform blocking calls or not.FastThreadLocalThreads are often used in event-loops, where blocking calls are forbidden in order to prevent event-loop stalls, so this method returnsfalseby default.Subclasses of
FastThreadLocalThreadcan override this method if they are not meant to be used for running event-loops.- Returns:
false, unless overriden by a subclass.
-