Exemplo n.º 1
0
 /*
  * 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();
 }
Exemplo n.º 2
0
 /*
  * 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));
 }