Move locks to own source file.