interruptedexception.html

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

HTML
993
字号
<A NAME="java.lang.ref"><!-- --></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="../ref/package-summary.html">java.lang.ref</A> 中 <A HREF="../InterruptedException.html" title="java.lang 中的类">InterruptedException</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="../InterruptedException.html" title="java.lang 中的类">InterruptedException</A> 的 <A HREF="../ref/package-summary.html">java.lang.ref</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../ref/Reference.html" title="java.lang.ref 中的类">Reference</A>&lt;? extends <A HREF="../ref/ReferenceQueue.html" title="ReferenceQueue 中的类型参数">T</A>&gt;</CODE></FONT></TD><TD><CODE><B>ReferenceQueue.</B><B><A HREF="../ref/ReferenceQueue.html#remove()">remove</A></B>()</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;<A HREF="../ref/Reference.html" title="java.lang.ref 中的类">Reference</A>&lt;? extends <A HREF="../ref/ReferenceQueue.html" title="ReferenceQueue 中的类型参数">T</A>&gt;</CODE></FONT></TD><TD><CODE><B>ReferenceQueue.</B><B><A HREF="../ref/ReferenceQueue.html#remove(long)">remove</A></B>(long&nbsp;timeout)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;移除此队列中的下一个引用对象,阻塞到有一个对象变得可用或者给定的超时期满了为止。</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="../InterruptedException.html" title="java.lang 中的类">InterruptedException</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="../InterruptedException.html" title="java.lang 中的类">InterruptedException</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;void</CODE></FONT></TD><TD><CODE><B>Semaphore.</B><B><A HREF="../../util/concurrent/Semaphore.html#acquire()">acquire</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从此信号量获取一个许可,在提供一个许可前一直将线程阻塞,否则线程被<A HREF="../Thread.html#interrupt()"><CODE>中断</CODE></A>。</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>Semaphore.</B><B><A HREF="../../util/concurrent/Semaphore.html#acquire(int)">acquire</A></B>(int&nbsp;permits)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从此信号量获取给定数目的许可,在提供这些许可前一直将线程阻塞,否则线程是<A HREF="../Thread.html#interrupt()"><CODE>已中断的</CODE></A>。</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>CyclicBarrier.</B><B><A HREF="../../util/concurrent/CyclicBarrier.html#await()">await</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在所有<A HREF="../../util/concurrent/CyclicBarrier.html#getParties()"><CODE>参与者</CODE></A>都已经在此 barrier 上调用 <tt>await</tt> 方法之前,将一直等待。</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>CountDownLatch.</B><B><A HREF="../../util/concurrent/CountDownLatch.html#await()">await</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使当前线程在锁存器倒计数至零之前一直等待,除非线程被<A HREF="../Thread.html#interrupt()"><CODE>中断</CODE></A>。</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>CyclicBarrier.</B><B><A HREF="../../util/concurrent/CyclicBarrier.html#await(long, java.util.concurrent.TimeUnit)">await</A></B>(long&nbsp;timeout,      <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在所有<A HREF="../../util/concurrent/CyclicBarrier.html#getParties()"><CODE>参与者</CODE></A>都已经在此屏障上调用 <tt>await</tt> 方法之前,将一直等待。</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>CountDownLatch.</B><B><A HREF="../../util/concurrent/CountDownLatch.html#await(long, java.util.concurrent.TimeUnit)">await</A></B>(long&nbsp;timeout,      <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使当前线程在锁存器倒计数至零之前一直等待,除非线程被<A HREF="../Thread.html#interrupt()"><CODE>中断</CODE></A>或超出了指定的等待时间。</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>ThreadPoolExecutor.</B><B><A HREF="../../util/concurrent/ThreadPoolExecutor.html#awaitTermination(long, java.util.concurrent.TimeUnit)">awaitTermination</A></B>(long&nbsp;timeout,                 <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</CODE><BR>&nbsp;&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>ExecutorService.</B><B><A HREF="../../util/concurrent/ExecutorService.html#awaitTermination(long, java.util.concurrent.TimeUnit)">awaitTermination</A></B>(long&nbsp;timeout,                 <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</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;<A HREF="../../util/concurrent/Exchanger.html" title="Exchanger 中的类型参数">V</A></CODE></FONT></TD><TD><CODE><B>Exchanger.</B><B><A HREF="../../util/concurrent/Exchanger.html#exchange(V)">exchange</A></B>(<A HREF="../../util/concurrent/Exchanger.html" title="Exchanger 中的类型参数">V</A>&nbsp;x)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;等待另一个线程到达此交换点(除非它被<A HREF="../Thread.html#interrupt()"><CODE>中断</CODE></A>),然后将给定的对象传送给该线程,并接收该线程的对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../util/concurrent/Exchanger.html" title="Exchanger 中的类型参数">V</A></CODE></FONT></TD><TD><CODE><B>Exchanger.</B><B><A HREF="../../util/concurrent/Exchanger.html#exchange(V, long, java.util.concurrent.TimeUnit)">exchange</A></B>(<A HREF="../../util/concurrent/Exchanger.html" title="Exchanger 中的类型参数">V</A>&nbsp;x,         long&nbsp;timeout,         <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;等待另一个线程到达此交换点(除非它被<A HREF="../Thread.html#interrupt()"><CODE>中断</CODE></A>,或者超出了指定的等待时间),然后将给定的对象传送给该线程,同时接收该线程的对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../util/concurrent/FutureTask.html" title="FutureTask 中的类型参数">V</A></CODE></FONT></TD><TD><CODE><B>FutureTask.</B><B><A HREF="../../util/concurrent/FutureTask.html#get()">get</A></B>()</CODE><BR>&nbsp;&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;<A HREF="../../util/concurrent/Future.html" title="Future 中的类型参数">V</A></CODE></FONT></TD><TD><CODE><B>Future.</B><B><A HREF="../../util/concurrent/Future.html#get()">get</A></B>()</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;<A HREF="../../util/concurrent/FutureTask.html" title="FutureTask 中的类型参数">V</A></CODE></FONT></TD><TD><CODE><B>FutureTask.</B><B><A HREF="../../util/concurrent/FutureTask.html#get(long, java.util.concurrent.TimeUnit)">get</A></B>(long&nbsp;timeout,    <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</CODE><BR>&nbsp;&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;<A HREF="../../util/concurrent/Future.html" title="Future 中的类型参数">V</A></CODE></FONT></TD><TD><CODE><B>Future.</B><B><A HREF="../../util/concurrent/Future.html#get(long, java.util.concurrent.TimeUnit)">get</A></B>(long&nbsp;timeout,    <A HREF="../../util/concurrent/TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</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><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="../../util/List.html" title="java.util 中的接口">List</A>&lt;<A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;T&gt;&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B>ExecutorService.</B><B><A HREF="../../util/concurrent/ExecutorService.html#invokeAll(java.util.Collection)">invokeAll</A></B>(<A HREF="../../util/Collection.html" title="java.util 中的接口">Collection</A>&lt;<A HREF="../../util/concurrent/Callable.html" title="java.util.concurrent 中的接口">Callable</A>&lt;T&gt;&gt;&nbsp;tasks)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;执行给定的任务,当所有任务完成时,返回保持任务状态和结果的 Future 列表。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; <A HREF="../../util/List.html" title="java.util 中的接口">List</A>&lt;<A HREF="../../util/concurrent/Future.html" title="java.util.concurrent 中的接口">Future</A>&lt;T&gt;&gt;</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B>AbstractExecutorService.</B><B><A HREF="../../util/concurrent/AbstractExecutorService.html#invokeAll(java.util.Collection)">invokeAll</A></B>(<A HREF="../../util/Collection.html" title="java.util 中的接口">Collection</A>&lt;<A HREF="../../util/concurrent/Callable.html" title="java.util.concurrent 中的接口">Callable</A>&lt;T&gt;&gt;&nbsp;tasks)</CODE><BR>&nbsp;&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">

⌨️ 快捷键说明

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