implement a mechanism to lock cache updates