How to use the Lock interface.