Netflix/blitz4j — pull request #2 by maximecaron (2013-04-29 01:55:18+00:00)
Title: set shutdown flag to true in stop() method before waiting for empty queu...

...e

After a quiet period the batch size and queue size might be empty thus ending the while loop but some new message had a chance to be added to the queue before the flag was set.
Thus calling the stop() method from a different thread than the one calling process was not threadsafe!