Call Report less often and with a mutex

This commit is contained in:
Henrique Gemignani Passos Lima 2021-08-07 02:53:57 +03:00
parent 53685b1efe
commit f282bdef1c
1 changed files with 4 additions and 3 deletions

View File

@ -266,16 +266,17 @@ void CPropertyNameGenerator::GenerateTask(const SPropertyNameGenerationParameter
}
}
// Every 250 tests, check with the progress notifier. Update the progress
// Every 5000 tests, check with the progress notifier. Update the progress
// bar and check whether the user has requested to cancel the operation.
TestsDone++;
if ( (TestsDone % 250) == 0 )
if ( (TestsDone % 5000) == 0 )
{
if (pProgress->ShouldCancel())
break;
auto Value = TotalTestsDone += 250;
std::unique_lock lock{mWarmupMutex};
auto Value = TotalTestsDone += 5000;
pProgress->Report(Value, TotalTests);
}
}