Revert "remove redundant locks"

This reverts commit 040b7d5fb9b6a6318da7143a8773ebcdcccb62f8.