/** * Blocks until the task is complete or the timeout expires. Throws a * {@link TimeoutException} if the timer expires, otherwise behaves like * {@link #get()}. */ V get(long nanos) throws TimeoutException, CancellationException, ExecutionException, InterruptedException { // Attempt to acquire the shared lock with a timeout. if (!tryAcquireSharedNanos(-1, nanos)) { throw new TimeoutException("Timeout waiting for task."); } return getValue(); }
/** * Blocks until the task is complete or the timeout expires. Throws a * {@link TimeoutException} if the timer expires, otherwise behaves like * {@link #get()}. */ V get(long nanos) throws TimeoutException, CancellationException, ExecutionException, InterruptedException { // Attempt to acquire the shared lock with a timeout. if (!tryAcquireSharedNanos(-1, nanos)) { throw new TimeoutException("Timeout waiting for task."); } return getValue(); }
/** * Blocks until the task is complete or the timeout expires. Throws a * {@link TimeoutException} if the timer expires, otherwise behaves like * {@link #get()}. */ V get(long nanos) throws TimeoutException, CancellationException, ExecutionException, InterruptedException { // Attempt to acquire the shared lock with a timeout. if (!tryAcquireSharedNanos(-1, nanos)) { throw new TimeoutException("Timeout waiting for task."); } return getValue(); }
/** * Blocks until the task is complete or the timeout expires. Throws a * {@link TimeoutException} if the timer expires, otherwise behaves like * {@link #get()}. */ V get(long nanos) throws TimeoutException, CancellationException, ExecutionException, InterruptedException { // Attempt to acquire the shared lock with a timeout. if (!tryAcquireSharedNanos(-1, nanos)) { throw new TimeoutException("Timeout waiting for task."); } return getValue(); }
/** * Blocks until the task is complete or the timeout expires. Throws a * {@link TimeoutException} if the timer expires, otherwise behaves like * {@link #get()}. */ V get(long nanos) throws TimeoutException, CancellationException, ExecutionException, InterruptedException { // Attempt to acquire the shared lock with a timeout. if (!tryAcquireSharedNanos(-1, nanos)) { throw new TimeoutException("Timeout waiting for task."); } return getValue(); }