code: void writeLock(int count) {
        if (count > 0 && counter != null)
           counter.acquireShared(count);
        sync.acquireShared(1);
     }
docs: Acquires the write lock and consumes the specified amount of buffer space. Blocks if the
  object is currently locked for reading, or if the buffer is full and count is greater than 0.
  
  @param count
  number of items the caller intends to write