Add a Lock object

Code was not tested.