I don't like recycling the flushThread variable here. It would be better to rename it to something more descriptive for being in the flush queue.