Revert "remove some lock"

This reverts commit 3e457e534f1041910369de5100b3590dfa29d15b.