code: public boolean decrementIfEnoughCredits(final Message msg, int credits, long timeout) {
          lock.lock();
          try {
              if(queuing)
                  return addToQueue(msg, credits);
              if(decrement(credits))
                  return true; // enough credits, message will be sent
              queuing=true;    // not enough credits, start queuing
              return addToQueue(msg, credits);
          }
          finally {
              lock.unlock();
          }
      }
docs: Decrements the sender's credits by the size of the message.
  @param msg The message
  @param credits The number of bytes to decrement the credits. Is {@link Message#length()}.
  @param timeout Ignored
  @return True if the message was sent, false if it was queued