软件包 | 描述 |
---|---|
java.lang |
提供对java编程语言的设计基础课。
|
java.util.concurrent |
在并发编程中常用的实用类。
|
java.util.concurrent.locks |
接口和类提供了一个锁定和等待条件的框架,这种情况与内置的同步和监视器不同。
|
javax.swing.text |
提供类和接口处理编辑和不可编辑的文本组件。
|
Modifier and Type | Method and Description |
---|---|
static Thread |
Thread.currentThread()
返回当前正在执行的线程对象的引用。
|
Modifier and Type | Method and Description |
---|---|
static Map<Thread,StackTraceElement[]> |
Thread.getAllStackTraces()
返回所有活线程的堆栈跟踪Map。
|
Modifier and Type | Method and Description |
---|---|
void |
Runtime.addShutdownHook(Thread hook)
注册一个新的虚拟机关机钩子。
|
void |
SecurityManager.checkAccess(Thread t)
抛出一个
SecurityException 如果调用线程不允许修改线参数。
|
static int |
Thread.enumerate(Thread[] tarray)
在当前线程的线程组和它的子组中的每一个活动线程中复制到指定的数组中。
|
int |
ThreadGroup.enumerate(Thread[] list)
在这个线程组及其子组中的每一个活动线程中拷贝到指定的数组中。
|
int |
ThreadGroup.enumerate(Thread[] list, boolean recurse)
在这个线程组中的每一个活动线程中复制到指定的数组中。
|
boolean |
Runtime.removeShutdownHook(Thread hook)
去注册一个以前注册的虚拟机关机钩子。
|
void |
Thread.UncaughtExceptionHandler.uncaughtException(Thread t, Throwable e)
方法调用时,给定线程终止由于未捕获的异常。
|
void |
ThreadGroup.uncaughtException(Thread t, Throwable e)
由java虚拟机时,一个线程,该线程组中的停止,因为未捕获的异常,和线程没有特定的
Thread.UncaughtExceptionHandler 安装。
|
Modifier and Type | Class and Description |
---|---|
class |
ForkJoinWorkerThread
一个线程的
ForkJoinPool 管理,执行
ForkJoinTask s。
|
Modifier and Type | Method and Description |
---|---|
Thread |
ThreadFactory.newThread(Runnable r)
构建了一种新的
Thread 。
|
Modifier and Type | Method and Description |
---|---|
protected Collection<Thread> |
Semaphore.getQueuedThreads()
返回一个包含可能等待获取的线程的集合。
|
Modifier and Type | Method and Description |
---|---|
protected void |
ThreadPoolExecutor.beforeExecute(Thread t, Runnable r)
方法调用在给定的线程执行给定的运行之前。
|
void |
TimeUnit.timedJoin(Thread thread, long timeout)
执行定时
Thread.join 利用这个时间单位。
|
Modifier and Type | Method and Description |
---|---|
protected Thread |
AbstractOwnableSynchronizer.getExclusiveOwnerThread()
返回的
setExclusiveOwnerThread 最后设置线程,或者如果没有
null 。
|
Thread |
AbstractQueuedSynchronizer.getFirstQueuedThread()
返回第一个(最长的等待队列中的线程),或
null 如果没有线程当前排队。
|
Thread |
AbstractQueuedLongSynchronizer.getFirstQueuedThread()
返回第一个(最长的等待队列中的线程),或
null 如果没有线程当前排队。
|
protected Thread |
ReentrantLock.getOwner()
返回该线程当前拥有该锁,或
null 如果不拥有。
|
protected Thread |
ReentrantReadWriteLock.getOwner()
返回该线程当前拥有写锁,或
null 如果不拥有。
|
Modifier and Type | Method and Description |
---|---|
Collection<Thread> |
AbstractQueuedSynchronizer.getExclusiveQueuedThreads()
返回一个包含可能等待在独占模式中获得的线程的集合。
|
Collection<Thread> |
AbstractQueuedLongSynchronizer.getExclusiveQueuedThreads()
返回一个包含可能等待在独占模式中获得的线程的集合。
|
protected Collection<Thread> |
ReentrantReadWriteLock.getQueuedReaderThreads()
返回一个包含可能等待获取读锁的线程的集合。
|
Collection<Thread> |
AbstractQueuedSynchronizer.getQueuedThreads()
返回一个包含可能等待获取的线程的集合。
|
protected Collection<Thread> |
ReentrantLock.getQueuedThreads()
返回一个包含可能等待获取此锁的线程的集合。
|
Collection<Thread> |
AbstractQueuedLongSynchronizer.getQueuedThreads()
返回一个包含可能等待获取的线程的集合。
|
protected Collection<Thread> |
ReentrantReadWriteLock.getQueuedThreads()
返回一个包含可能等待获取读写锁的线程的集合。
|
protected Collection<Thread> |
ReentrantReadWriteLock.getQueuedWriterThreads()
返回一个包含可能等待获取写锁的线程的集合。
|
Collection<Thread> |
AbstractQueuedSynchronizer.getSharedQueuedThreads()
返回一个包含可能等待在共享模式中获取的线程的集合。
|
Collection<Thread> |
AbstractQueuedLongSynchronizer.getSharedQueuedThreads()
返回一个包含可能等待在共享模式中获取的线程的集合。
|
protected Collection<Thread> |
AbstractQueuedSynchronizer.ConditionObject.getWaitingThreads()
返回包含可能在这种情况下等待的线程的集合。
|
protected Collection<Thread> |
AbstractQueuedLongSynchronizer.ConditionObject.getWaitingThreads()
返回包含可能在这种情况下等待的线程的集合。
|
Collection<Thread> |
AbstractQueuedLongSynchronizer.getWaitingThreads(AbstractQueuedLongSynchronizer.ConditionObject condition)
返回一个集合,可以在给定的条件下,与此相关的线程同步。
|
Collection<Thread> |
AbstractQueuedSynchronizer.getWaitingThreads(AbstractQueuedSynchronizer.ConditionObject condition)
返回一个集合,可以在给定的条件下,与此相关的线程同步。
|
protected Collection<Thread> |
ReentrantLock.getWaitingThreads(Condition condition)
返回一个集合,包含可能在与此锁关联的给定条件下等待的线程集合。
|
protected Collection<Thread> |
ReentrantReadWriteLock.getWaitingThreads(Condition condition)
返回包含这些线程的集合,这些线程可能在与写锁关联的给定条件下等待。
|
Modifier and Type | Method and Description |
---|---|
static Object |
LockSupport.getBlocker(Thread t)
返回给一个尚未畅通公园最近的方法调用模型对象,或空如果不堵塞。
|
boolean |
ReentrantLock.hasQueuedThread(Thread thread)
查询给定线程是否正在等待获取此锁。
|
boolean |
ReentrantReadWriteLock.hasQueuedThread(Thread thread)
查询给定线程是否等待获取读或写锁。
|
boolean |
AbstractQueuedSynchronizer.isQueued(Thread thread)
如果给定线程当前正在排队,则返回真。
|
boolean |
AbstractQueuedLongSynchronizer.isQueued(Thread thread)
如果给定线程当前正在排队,则返回真。
|
protected void |
AbstractOwnableSynchronizer.setExclusiveOwnerThread(Thread thread)
设置当前拥有独占访问的线程。
|
static void |
LockSupport.unpark(Thread thread)
使可用的许可证为给定的线程,如果它不是已经可用。
|
Modifier and Type | Method and Description |
---|---|
protected Thread |
AbstractDocument.getCurrentWriter()
获取当前线程是否有一个写作。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.