Uses of Class
java.lang.Thread
Packages that useThread
Package
Description
Provides classes that are fundamental to the design of the Javaprogramming language.
Provides low-level access to memory and functions outside the Java runtime.
Utility classes commonly useful in concurrent programming.
Interfaces and classes providing a framework for locking and waitingfor conditions that is distinct from built-in synchronization andmonitors.
Provides classes and interfaces that deal with editable and noneditable textcomponents.
Uses ofThread injava.lang
Modifier and TypeMethodDescriptionstaticThreadThread.currentThread()Returns the Thread object for the current thread.Creates a newThreadfrom the current state of the builder andschedules it to execute.staticThreadThread.startVirtualThread(Runnable task) Creates a virtual thread to execute a task and schedules it to execute.Creates a newThreadfrom the current state of the builder torun the given task.Modifier and TypeMethodDescriptionstaticMap<Thread,StackTraceElement[]> Thread.getAllStackTraces()Returns a map of stack traces for all live platform 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.ThrowsSecurityException.static intCopies into the specified array everyliveplatform thread in the current thread's thread group and its subgroups.intCopies into the specified array everyliveplatform thread in this thread group and its subgroups.intCopies into the specified array everyliveplatform 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 thegiven uncaught exception.voidThreadGroup.uncaughtException(Thread t,Throwable e) Called by the Java Virtual Machine when a thread in thisthread group stops because of an uncaught exception, and the threaddoes not have a specificThread.UncaughtExceptionHandlerinstalled.Uses ofThread injava.lang.foreign
Methods injava.lang.foreign with parameters of typeThreadModifier and TypeMethodDescriptionbooleanMemorySegment.isAccessibleBy(Thread thread) Returnstrueif this segment can be accessed from the provided thread.Uses ofThread injava.util.concurrent
Subclasses ofThread injava.util.concurrentModifier and TypeClassDescriptionclassA thread managed by aForkJoinPool, which executesForkJoinTasks.Methods injava.util.concurrent that returnThreadModifier and TypeMethodDescriptionConstructs a new unstartedThreadto run the given runnable.Methods injava.util.concurrent that return types with arguments of typeThreadModifier and TypeMethodDescriptionprotectedCollection<Thread> Semaphore.getQueuedThreads()Returns a collection containing threads that may be waiting to acquire.Methods injava.util.concurrent with parameters of typeThreadModifier and TypeMethodDescriptionprotected voidThreadPoolExecutor.beforeExecute(Thread t,Runnable r) Method invoked prior to executing the given Runnable in thegiven thread.voidPerforms a timedThread.joinusing this time unit.Uses ofThread injava.util.concurrent.locks
Methods injava.util.concurrent.locks that returnThreadModifier and TypeMethodDescriptionprotected finalThreadAbstractOwnableSynchronizer.getExclusiveOwnerThread()Returns the thread last set bysetExclusiveOwnerThread,ornullif never set.finalThreadAbstractQueuedLongSynchronizer.getFirstQueuedThread()Returns the first (longest-waiting) thread in the queue, ornullif no threads are currently queued.finalThreadAbstractQueuedSynchronizer.getFirstQueuedThread()Returns the first (longest-waiting) thread in the queue, ornullif no threads are currently queued.protectedThreadReentrantLock.getOwner()Returns the thread that currently owns this lock, ornullif not owned.protectedThreadReentrantReadWriteLock.getOwner()Returns the thread that currently owns the write lock, ornullif not owned.Methods injava.util.concurrent.locks that return types with arguments of typeThreadModifier and TypeMethodDescriptionfinalCollection<Thread> AbstractQueuedLongSynchronizer.getExclusiveQueuedThreads()Returns a collection containing threads that may be waiting toacquire in exclusive mode.finalCollection<Thread> AbstractQueuedSynchronizer.getExclusiveQueuedThreads()Returns a collection containing threads that may be waiting toacquire in exclusive mode.protectedCollection<Thread> ReentrantReadWriteLock.getQueuedReaderThreads()Returns a collection containing threads that may be waiting toacquire the read lock.finalCollection<Thread> AbstractQueuedLongSynchronizer.getQueuedThreads()Returns a collection containing threads that may be waiting toacquire.finalCollection<Thread> AbstractQueuedSynchronizer.getQueuedThreads()Returns a collection containing threads that may be waiting toacquire.protectedCollection<Thread> ReentrantLock.getQueuedThreads()Returns a collection containing threads that may be waiting toacquire this lock.protectedCollection<Thread> ReentrantReadWriteLock.getQueuedThreads()Returns a collection containing threads that may be waiting toacquire either the read or write lock.protectedCollection<Thread> ReentrantReadWriteLock.getQueuedWriterThreads()Returns a collection containing threads that may be waiting toacquire the write lock.finalCollection<Thread> AbstractQueuedLongSynchronizer.getSharedQueuedThreads()Returns a collection containing threads that may be waiting toacquire in shared mode.finalCollection<Thread> AbstractQueuedSynchronizer.getSharedQueuedThreads()Returns a collection containing threads that may be waiting toacquire in shared mode.protected finalCollection<Thread> AbstractQueuedLongSynchronizer.ConditionObject.getWaitingThreads()Returns a collection containing those threads that may bewaiting on this Condition.finalCollection<Thread> AbstractQueuedLongSynchronizer.getWaitingThreads(AbstractQueuedLongSynchronizer.ConditionObject condition) Returns a collection containing those threads that may bewaiting on the given condition associated with thissynchronizer.protected finalCollection<Thread> AbstractQueuedSynchronizer.ConditionObject.getWaitingThreads()Returns a collection containing those threads that may bewaiting on this Condition.finalCollection<Thread> AbstractQueuedSynchronizer.getWaitingThreads(AbstractQueuedSynchronizer.ConditionObject condition) Returns a collection containing those threads that may bewaiting on the given condition associated with thissynchronizer.protectedCollection<Thread> ReentrantLock.getWaitingThreads(Condition condition) Returns a collection containing those threads that may bewaiting on the given condition associated with this lock.protectedCollection<Thread> ReentrantReadWriteLock.getWaitingThreads(Condition condition) Returns a collection containing those threads that may bewaiting on the given condition associated with the write lock.Methods injava.util.concurrent.locks with parameters of typeThreadModifier and TypeMethodDescriptionstaticObjectLockSupport.getBlocker(Thread t) Returns the blocker object supplied to the most recentinvocation of a park method that has not yet unblocked, or nullif not blocked.final booleanReentrantLock.hasQueuedThread(Thread thread) Queries whether the given thread is waiting to acquire thislock.final booleanReentrantReadWriteLock.hasQueuedThread(Thread thread) Queries whether the given thread is waiting to acquire eitherthe 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 itwas not already available.Uses ofThread injavax.swing.text
Methods injavax.swing.text that returnThreadModifier and TypeMethodDescriptionprotected finalThreadAbstractDocument.getCurrentWriter()Fetches the current writing thread if there is one.