code: public void takeOne() {
        while (true) {
           int stored = spent.get();
           if (stored >= thingsPerTick)
              sleep();
           else if (spent.compareAndSet(stored, stored + 1))
              break;
        }
     }
docs: Takes one thing (eg. byte). This method blocks until one thing can be used
  according to the current rate and prescaling settings.