code: private boolean doAcquireSharedNanos(int arg, long nanosTimeout)
              throws InterruptedException {
          if (nanosTimeout <= 0L)
              return false;
          final long deadline = System.nanoTime() + nanosTimeout;
          final Node node = addWaiter(Node.SHARED);
          try {
              for (;;) {
                  final Node p = node.predecessor();
                  if (p == head) {
                      int r = tryAcquireShared(arg);
                      if (r >= 0) {
                          setHeadAndPropagate(node, r);
                          p.next = null; // help GC
                          return true;
                      }
                  }
                  nanosTimeout = deadline - System.nanoTime();
                  if (nanosTimeout <= 0L) {
                      cancelAcquire(node);
                      return false;
                  }
                  if (shouldParkAfterFailedAcquire(p, node) &&
                      nanosTimeout > SPIN_FOR_TIMEOUT_THRESHOLD)
                      LockSupport.parkNanos(this, nanosTimeout);
                  if (Thread.interrupted())
                      throw new InterruptedException();
              }
          } catch (Throwable t) {
              cancelAcquire(node);
              throw t;
          }
      }
docs: Acquires in shared timed mode.
  
  @param arg the acquire argument
  @param nanosTimeout max wait time
  @return {@code true} if acquired