code: public BlockEncodeRequest getWaitingRequest() {
      BlockEncodeRequest result = null;
      synchronized(getLock) {
        boolean loop = true;
        try {
          while(loop) {
            result = unassignedEncodeRequests.poll(500, TimeUnit.MILLISECONDS);
            if(result != null) {
              synchronized(outstandingCountLock) {
              outstandingCountLock.notifyAll();
            }
            orderedEncodeRequests.add(result);
            }
            loop = false;
          }
        } catch(InterruptedException e) {
            Thread.currentThread().interrupt();
        }
      }
      return result;
    }
docs: Get a BlockEncodeRequest object which is queued for encoding, pausing for
  up to 0.5 seconds till one is available. It is expected that this object
  will later(after encoding to a FLAC frame) be returned to this manager
  through the returnFinishedRequest method. Failure to return the finished
  object will cause the encoding process to hang.
  
  @return BlockEncodingRequest to encode, null if none available.