Synchronization with Modification of the Lock Reference

...is very bad practice. Nevertheless, it is not so rare to meet it.