lock file by extending thread in mapped files