Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; public class Main { public static <V> V getUninterruptibly(Future<V> future) throws ExecutionException { boolean interrupted = false; try { while (true) { try { return future.get(); } catch (InterruptedException e) { interrupted = true; } } } finally { if (interrupted) { Thread.currentThread().interrupt(); } } } }