Add a Lock object

Code was not tested.
Merge pull request #1 from ekimekim/master

Add a Lock object