/* * Blocks until the task completes or we get interrupted. Uses the * interruptible blocking support provided by AQS. */ @Override public V get() throws InterruptedException, ExecutionException { return sync.get(); }
/* * Blocks until either the task completes or the timeout expires. Uses the * sync blocking-with-timeout support provided by AQS. */ @Override public V get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException { return sync.get(unit.toNanos(timeout)); }