code: public void acquireWrite() {
          if (stats != null) {    // stats is null by default
              synchronized (this) {
                  stats._wc++;
                  if (rwl.getReadLockCount() > 0 || rwl.isWriteLocked()) {
                      stats._wwc++;
                  }
              }
          }
          rwl.writeLock().lock();
      }
docs: <p>Acquire the write lock, blocking until the write lock is
  available.  Only one writer can acquire the write lock, and
  when held, no readers can acquire the read lock.</p>
  
  <p>If there are no readers and no waiting writers, mark as
  having an active writer and return.  Otherwise, add a lock to the
  end of the waiting writer list, and block on it.  Caller
  must call releaseWrite when done (for example, in a finally
  block).<p>