Java ApacheMina等待vs不间断地等待
这两种方法的区别是什么?在哪种情况下,应使用一个而不是另一个Java ApacheMina等待vs不间断地等待,java,apache-mina,Java,Apache Mina,这两种方法的区别是什么?在哪种情况下,应使用一个而不是另一个 /** * 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.
*
* @return <tt>true</tt> if the operation is completed.
*/
boolean await(long timeoutMillis) throws InterruptedException;
/**
*等待异步操作在指定的超时时间内完成。
*
*@如果操作完成,则返回true。
*/
布尔等待(longtimeoutmillis)抛出中断异常;
对
/**
* 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);
/**
*等待异步操作在指定的超时时间内完成
*不间断地。
*
*@如果操作完成,则返回true。
*/
不间断地等待(长超时毫秒);
你知道什么是中断吗?thread.interrupt()?现在你知道一个会忽略这个调用/标志,另一个会抛出一个异常。这似乎毫无意义。也许你想得太多了。告诉自己这很简单