Added a lock file mechanism to IndexAll();