Basic thin lock

This contribution is made under the terms of the MIT license.