code: public void blockWhileQueueExceeds(int count) {
      boolean loop = true;
      boolean interrupted = false;
      try {
        do {
        synchronized(outstandingCountLock) {
          if(outstandingCount > count) {
            try {
              outstandingCountLock.wait();
            }catch(InterruptedException e) {
              //ignore interruption, loop again.
              interrupted = true;
            }
          }
          else
          loop = false;
          }
        }while(loop);
      }finally {
        if(interrupted)
        Thread.currentThread().interrupt();
      }
    }
docs: This function is used to help control flow of BlockEncodeRequests into
  this manager. It will block so long as their is at least as many
  unprocessed blocks waiting to be encoded as the value given.
  
  @param count Maximum number of outstanding requests that may exist before
  this method may return.