Update examples to use Lock