Thread.yield(); }
while (activationCount.get() != 0) { try { activationLock.wait(); } catch (InterruptedException e) { log.error("Thread interrupted", e); } } }
   public synchronized void close()   {      closed = true;                stopReceiver();                   //There may still be pending calls to activateConsumer - we wait for them to complete (or fail)      while (activationCount.get() != 0)      {         Thread.yield();      }        }