thread.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 521 行 · 第 1/3 页

HTML
521
字号
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B>ThreadGroup.</B><B><A HREF="../ThreadGroup.html#enumerate(java.lang.Thread[])">enumerate</A></B>(<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>[]&nbsp;list)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;把此线程组及其子组中的所有活动线程复制到指定数组中。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B>ThreadGroup.</B><B><A HREF="../ThreadGroup.html#enumerate(java.lang.Thread[], boolean)">enumerate</A></B>(<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>[]&nbsp;list,          boolean&nbsp;recurse)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;把此线程组中的所有活动线程复制到指定数组中。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>Runtime.</B><B><A HREF="../Runtime.html#removeShutdownHook(java.lang.Thread)">removeShutdownHook</A></B>(<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>&nbsp;hook)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;取消注册某个先前已注册的虚拟机关闭挂钩。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B>Thread.UncaughtExceptionHandler.</B><B><A HREF="../Thread.UncaughtExceptionHandler.html#uncaughtException(java.lang.Thread, java.lang.Throwable)">uncaughtException</A></B>(<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>&nbsp;t,                  <A HREF="../Throwable.html" title="java.lang 中的类">Throwable</A>&nbsp;e)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当给定线程因给定的未捕获异常而终止时,调用该方法。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B>ThreadGroup.</B><B><A HREF="../ThreadGroup.html#uncaughtException(java.lang.Thread, java.lang.Throwable)">uncaughtException</A></B>(<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>&nbsp;t,                  <A HREF="../Throwable.html" title="java.lang 中的类">Throwable</A>&nbsp;e)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当此线程组中的线程因为一个未捕获的异常而停止,并且线程没有安装特定 <A HREF="../Thread.UncaughtExceptionHandler.html" title="java.lang 中的接口"><CODE>Thread.UncaughtExceptionHandler</CODE></A> 时,由 Java Virtual Machine 调用此方法。</TD></TR></TABLE>&nbsp;<P><A NAME="java.util.concurrent"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><A HREF="../../util/concurrent/package-summary.html">java.util.concurrent</A> 中 <A HREF="../Thread.html" title="java.lang 中的类">Thread</A> 的使用</FONT></TH></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">返回 <A HREF="../Thread.html" title="java.lang 中的类">Thread</A> 的 <A HREF="../../util/concurrent/package-summary.html">java.util.concurrent</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../Thread.html" title="java.lang 中的类">Thread</A></CODE></FONT></TD><TD><CODE><B>ThreadFactory.</B><B><A HREF="../../util/concurrent/ThreadFactory.html#newThread(java.lang.Runnable)">newThread</A></B>(<A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;r)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;构造一个新 <tt>Thread</tt>。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">返回变量类型为 <A HREF="../Thread.html" title="java.lang 中的类">Thread</A> 的类型的 <A HREF="../../util/concurrent/package-summary.html">java.util.concurrent</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../../util/Collection.html" title="java.util 中的接口">Collection</A>&lt;<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>&gt;</CODE></FONT></TD><TD><CODE><B>Semaphore.</B><B><A HREF="../../util/concurrent/Semaphore.html#getQueuedThreads()">getQueuedThreads</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个 collection,包含可能等待获取的线程。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">参数类型为 <A HREF="../Thread.html" title="java.lang 中的类">Thread</A> 的 <A HREF="../../util/concurrent/package-summary.html">java.util.concurrent</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B>ThreadPoolExecutor.</B><B><A HREF="../../util/concurrent/ThreadPoolExecutor.html#beforeExecute(java.lang.Thread, java.lang.Runnable)">beforeExecute</A></B>(<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>&nbsp;t,              <A HREF="../Runnable.html" title="java.lang 中的接口">Runnable</A>&nbsp;r)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在执行给定线程中的给定 Runnable 之前调用的方法。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B>TimeUnit.</B><B><A HREF="../../util/concurrent/TimeUnit.html#timedJoin(java.lang.Thread, long)">timedJoin</A></B>(<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>&nbsp;thread,          long&nbsp;timeout)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用此时间单元执行计时的 <tt>Thread.join</tt>。</TD></TR></TABLE>&nbsp;<P><A NAME="java.util.concurrent.locks"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><A HREF="../../util/concurrent/locks/package-summary.html">java.util.concurrent.locks</A> 中 <A HREF="../Thread.html" title="java.lang 中的类">Thread</A> 的使用</FONT></TH></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">返回 <A HREF="../Thread.html" title="java.lang 中的类">Thread</A> 的 <A HREF="../../util/concurrent/locks/package-summary.html">java.util.concurrent.locks</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../Thread.html" title="java.lang 中的类">Thread</A></CODE></FONT></TD><TD><CODE><B>AbstractQueuedSynchronizer.</B><B><A HREF="../../util/concurrent/locks/AbstractQueuedSynchronizer.html#getFirstQueuedThread()">getFirstQueuedThread</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回队列中第一个(等待时间最长的)线程,如果目前没有将任何线程加入队列,则返回 <tt>null</tt>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../Thread.html" title="java.lang 中的类">Thread</A></CODE></FONT></TD><TD><CODE><B>ReentrantLock.</B><B><A HREF="../../util/concurrent/locks/ReentrantLock.html#getOwner()">getOwner</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回目前拥有此锁定的线程,如果此锁定不被任何线程拥有,则返回 <tt>null</tt>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../Thread.html" title="java.lang 中的类">Thread</A></CODE></FONT></TD><TD><CODE><B>ReentrantReadWriteLock.</B><B><A HREF="../../util/concurrent/locks/ReentrantReadWriteLock.html#getOwner()">getOwner</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回当前拥有写入锁定的线程,如果没有这样的线程,则返回 <tt>null</tt>。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">返回变量类型为 <A HREF="../Thread.html" title="java.lang 中的类">Thread</A> 的类型的 <A HREF="../../util/concurrent/locks/package-summary.html">java.util.concurrent.locks</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../util/Collection.html" title="java.util 中的接口">Collection</A>&lt;<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>&gt;</CODE></FONT></TD><TD><CODE><B>AbstractQueuedSynchronizer.</B><B><A HREF="../../util/concurrent/locks/AbstractQueuedSynchronizer.html#getExclusiveQueuedThreads()">getExclusiveQueuedThreads</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回包含可能正以独占模式等待获取的线程 collection。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../../util/Collection.html" title="java.util 中的接口">Collection</A>&lt;<A HREF="../Thread.html" title="java.lang 中的类">Thread</A>&gt;</CODE></FONT></TD><TD><CODE><B>ReentrantReadWriteLock.</B><B><A HREF="../../util/concurrent/locks/ReentrantReadWriteLock.html#getQueuedReaderThreads()">getQueuedReaderThreads</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个 collection,它包含可能正在等待获取读取锁定的线程。</TD></TR>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?