public V get() throws InterruptedException, ExecutionException { stateLock.lock(); try { while (!isDone()) { finishedCondition.await(); } if (exception != null) { throw exception; } return result; } finally { stateLock.unlock(); } }
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { stateLock.lock(); try { if (!isDone()) { finishedCondition.await(timeout, unit); } if (exception != null) { throw exception; } if (result == null) { throw new TimeoutException("Object not returned in time allocated."); } return result; } finally { stateLock.unlock(); } }
public V get() throws InterruptedException, ExecutionException { stateLock.lock(); try { while (!isDone()) { finishedCondition.await(); } if (exception != null) { throw exception; } return result; } finally { stateLock.unlock(); } }
public V get() throws InterruptedException, ExecutionException { stateLock.lock(); try { while (!isDone()) { finishedCondition.await(); } if (exception != null) { throw exception; } return result; } finally { stateLock.unlock(); } }
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { stateLock.lock(); try { if (!isDone()) { finishedCondition.await(timeout, unit); } if (exception != null) { throw exception; } if (result == null) { throw new TimeoutException("Object not returned in time allocated."); } return result; } finally { stateLock.unlock(); } }
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { stateLock.lock(); try { if (!isDone()) { finishedCondition.await(timeout, unit); } if (exception != null) { throw exception; } if (result == null) { throw new TimeoutException("Object not returned in time allocated."); } return result; } finally { stateLock.unlock(); } }