From f282bdef1cc15aa84591ac63bc05d76928faa21d Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Sat, 7 Aug 2021 02:53:57 +0300 Subject: [PATCH] Call Report less often and with a mutex --- .../Resource/Script/Property/CPropertyNameGenerator.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Core/Resource/Script/Property/CPropertyNameGenerator.cpp b/src/Core/Resource/Script/Property/CPropertyNameGenerator.cpp index 7f531a44..420393bc 100644 --- a/src/Core/Resource/Script/Property/CPropertyNameGenerator.cpp +++ b/src/Core/Resource/Script/Property/CPropertyNameGenerator.cpp @@ -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); } }