Make sure only a single thread can process a queued file