Uses of Class
java.lang.Thread
Packages that use Thread
Package
Description
Provides classes that are fundamental to the design of the Java
programming language.
Utility classes commonly useful in concurrent programming.
Interfaces and classes providing a framework for locking and waiting
for conditions that is distinct from built-in synchronization and
monitors.
Provides classes and interfaces that deal with editable and noneditable text
components.
Classes to support low-level and efficient foreign memory/function access, directly from Java.
-
Uses of Thread in java.lang
Modifier and TypeMethodDescriptionstatic ThreadThread.currentThread()Returns a reference to the currently executing thread object.Modifier and TypeMethodDescriptionstatic Map<Thread,StackTraceElement[]> Thread.getAllStackTraces()Returns a map of stack traces for all live threads.Modifier and TypeMethodDescriptionvoidRuntime.addShutdownHook(Thread hook) Registers a new virtual-machine shutdown hook.voidSecurityManager.checkAccess(Thread t) Deprecated, for removal: This API element is subject to removal in a future version.Throws aSecurityExceptionif the calling thread is not allowed to modify the thread argument.static intCopies into the specified array every active thread in the current thread's thread group and its subgroups.intCopies into the specified array every active thread in this thread group and its subgroups.intCopies into the specified array every active thread in this thread group.booleanRuntime.removeShutdownHook(Thread hook) De-registers a previously-registered virtual-machine shutdown hook.voidThread.UncaughtExceptionHandler.uncaughtException(Thread t, Throwable e) Method invoked when the given thread terminates due to the given uncaught exception.voidThreadGroup.uncaughtException(Thread t, Throwable e) Called by the Java Virtual Machine when a thread in this thread group stops because of an uncaught exception, and the thread does not have a specificThread.UncaughtExceptionHandlerinstalled. -
Uses of Thread in java.util.concurrent
Subclasses of Thread in java.util.concurrentModifier and TypeClassDescriptionclassA thread managed by aForkJoinPool, which executesForkJoinTasks.Methods in java.util.concurrent that return ThreadModifier and TypeMethodDescriptionConstructs a newThread.Methods in java.util.concurrent that return types with arguments of type ThreadModifier and TypeMethodDescriptionprotected Collection<Thread>Semaphore.getQueuedThreads()Returns a collection containing threads that may be waiting to acquire.Methods in java.util.concurrent with parameters of type ThreadModifier and TypeMethodDescriptionprotected voidThreadPoolExecutor.beforeExecute(Thread t, Runnable r) Method invoked prior to executing the given Runnable in the given thread.voidPerforms a timedThread.joinusing this time unit. -
Uses of Thread in java.util.concurrent.locks
Methods in java.util.concurrent.locks that return ThreadModifier and TypeMethodDescriptionprotected final ThreadAbstractOwnableSynchronizer.getExclusiveOwnerThread()Returns the thread last set bysetExclusiveOwnerThread, ornullif never set.final ThreadAbstractQueuedLongSynchronizer.getFirstQueuedThread()Returns the first (longest-waiting) thread in the queue, ornullif no threads are currently queued.final ThreadAbstractQueuedSynchronizer.getFirstQueuedThread()Returns the first (longest-waiting) thread in the queue, ornullif no threads are currently queued.protected ThreadReentrantLock.getOwner()Returns the thread that currently owns this lock, ornullif not owned.protected ThreadReentrantReadWriteLock.getOwner()Returns the thread that currently owns the write lock, ornullif not owned.Methods in java.util.concurrent.locks that return types with arguments of type ThreadModifier and TypeMethodDescriptionfinal Collection<Thread>AbstractQueuedLongSynchronizer.getExclusiveQueuedThreads()Returns a collection containing threads that may be waiting to acquire in exclusive mode.final Collection<Thread>AbstractQueuedSynchronizer.getExclusiveQueuedThreads()Returns a collection containing threads that may be waiting to acquire in exclusive mode.protected Collection<Thread>ReentrantReadWriteLock.getQueuedReaderThreads()Returns a collection containing threads that may be waiting to acquire the read lock.final Collection<Thread>AbstractQueuedLongSynchronizer.getQueuedThreads()Returns a collection containing threads that may be waiting to acquire.final Collection<Thread>AbstractQueuedSynchronizer.getQueuedThreads()Returns a collection containing threads that may be waiting to acquire.protected Collection<Thread>ReentrantLock.getQueuedThreads()Returns a collection containing threads that may be waiting to acquire this lock.protected Collection<Thread>ReentrantReadWriteLock.getQueuedThreads()Returns a collection containing threads that may be waiting to acquire either the read or write lock.protected Collection<Thread>ReentrantReadWriteLock.getQueuedWriterThreads()Returns a collection containing threads that may be waiting to acquire the write lock.final Collection<Thread>AbstractQueuedLongSynchronizer.getSharedQueuedThreads()Returns a collection containing threads that may be waiting to acquire in shared mode.final Collection<Thread>AbstractQueuedSynchronizer.getSharedQueuedThreads()Returns a collection containing threads that may be waiting to acquire in shared mode.protected final Collection<Thread>AbstractQueuedLongSynchronizer.ConditionObject.getWaitingThreads()Returns a collection containing those threads that may be waiting on this Condition.final Collection<Thread>AbstractQueuedLongSynchronizer.getWaitingThreads(AbstractQueuedLongSynchronizer.ConditionObject condition) Returns a collection containing those threads that may be waiting on the given condition associated with this synchronizer.protected final Collection<Thread>AbstractQueuedSynchronizer.ConditionObject.getWaitingThreads()Returns a collection containing those threads that may be waiting on this Condition.final Collection<Thread>AbstractQueuedSynchronizer.getWaitingThreads(AbstractQueuedSynchronizer.ConditionObject condition) Returns a collection containing those threads that may be waiting on the given condition associated with this synchronizer.protected Collection<Thread>ReentrantLock.getWaitingThreads(Condition condition) Returns a collection containing those threads that may be waiting on the given condition associated with this lock.protected Collection<Thread>ReentrantReadWriteLock.getWaitingThreads(Condition condition) Returns a collection containing those threads that may be waiting on the given condition associated with the write lock.Methods in java.util.concurrent.locks with parameters of type ThreadModifier and TypeMethodDescriptionstatic ObjectLockSupport.getBlocker(Thread t) Returns the blocker object supplied to the most recent invocation of a park method that has not yet unblocked, or null if not blocked.final booleanReentrantLock.hasQueuedThread(Thread thread) Queries whether the given thread is waiting to acquire this lock.final booleanReentrantReadWriteLock.hasQueuedThread(Thread thread) Queries whether the given thread is waiting to acquire either the read or write lock.final booleanReturns true if the given thread is currently queued.final booleanReturns true if the given thread is currently queued.protected final voidAbstractOwnableSynchronizer.setExclusiveOwnerThread(Thread thread) Sets the thread that currently owns exclusive access.static voidMakes available the permit for the given thread, if it was not already available. -
Uses of Thread in javax.swing.text
Methods in javax.swing.text that return ThreadModifier and TypeMethodDescriptionprotected final ThreadAbstractDocument.getCurrentWriter()Fetches the current writing thread if there is one. -
Uses of Thread in jdk.incubator.foreign
Methods in jdk.incubator.foreign that return ThreadModifier and TypeMethodDescriptionResourceScope.ownerThread()The thread owning this resource scope.