I could make the synchronized block a little tighter if I use an ArrayDeque instead. I'll work on that.