The flush thread currently does all its work under an exclusive flush lock. Once deadlock is implemented, this should be changed to be done under S-lock, so that concurrent readers are allowed.