NAppUpdate.Framework.Tasks.FileUpdateTask.FileLockWait C# (CSharp) Method

FileLockWait() private method

To mitigate problems with the files being locked even though the application mutex has been released. https://github.com/synhershko/NAppUpdate/issues/35
private FileLockWait ( ) : void
return void
        private void FileLockWait()
        {
            int attempt = 0;
            while (FileSystem.IsFileLocked(new FileInfo(_destinationFile)))
            {
                Thread.Sleep(500);
                attempt++;
                if (attempt == 10)
                {
                    throw new UpdateProcessFailedException("Failed to update, the file is locked: " + _destinationFile);
                }
            }
        }