Java Code Examples for org.apache.mina.core.future.IoFuture#awaitUninterruptibly()
The following examples show how to use
org.apache.mina.core.future.IoFuture#awaitUninterruptibly() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IoUtil.java From neoscada with Eclipse Public License 1.0 | 5 votes |
private static boolean await0(Iterable<? extends IoFuture> futures, long timeoutMillis, boolean interruptable) throws InterruptedException { long startTime = timeoutMillis <= 0 ? 0 : System.currentTimeMillis(); long waitTime = timeoutMillis; boolean lastComplete = true; Iterator<? extends IoFuture> i = futures.iterator(); while (i.hasNext()) { IoFuture f = i.next(); do { if (interruptable) { lastComplete = f.await(waitTime); } else { lastComplete = f.awaitUninterruptibly(waitTime); } waitTime = timeoutMillis - (System.currentTimeMillis() - startTime); if (lastComplete || waitTime <= 0) { break; } } while (!lastComplete); if (waitTime <= 0) { break; } } return lastComplete && !i.hasNext(); }
Example 2
Source File: IoUtil.java From neoscada with Eclipse Public License 1.0 | 4 votes |
public static void awaitUninterruptably(Iterable<? extends IoFuture> futures) { for (IoFuture f : futures) { f.awaitUninterruptibly(); } }