These locks will go away after some more refactoring.