Add a lock method

For use with method lock()