Implemented lock.