2

两种方法有什么区别?在哪种情况下应该使用一个而不是另一个?

/**
 * Wait for the asynchronous operation to complete with the specified timeout.
 *
 * @return <tt>true</tt> if the operation is completed.
 */
boolean await(long timeoutMillis) throws InterruptedException;

相对

/**
 * Wait for the asynchronous operation to complete with the specified timeout
 * uninterruptibly.
 *
 * @return <tt>true</tt> if the operation is finished.
 */
boolean awaitUninterruptibly(long timeoutMillis);
4

0 回答 0