Lifetime elision for lock()