Implemented extension lock and directory lock.