Add deprecation warning to lock class