Add ScopedLock implementation.