From 8941899c4f0feeba53bb9a4d6a7d00913d99100f Mon Sep 17 00:00:00 2001 From: Robert Bryce Date: Sat, 23 Nov 2024 15:42:01 -0600 Subject: [PATCH] Added std::atomic to make sure memory fences are properly enforced. https://github.com/WISE-Developers/WISE_Application/issues/60 --- WISE_Project/cpp/Scenario.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WISE_Project/cpp/Scenario.cpp b/WISE_Project/cpp/Scenario.cpp index ee13a07..d6ad158 100644 --- a/WISE_Project/cpp/Scenario.cpp +++ b/WISE_Project/cpp/Scenario.cpp @@ -777,7 +777,7 @@ HRESULT Project::Scenario::Simulation_Step() return m_scenario->Simulation_Step(); HRESULT hr = S_OK; - ULONG complete_count = 0; + std::atomic complete_count = 0; int si; int thread_id = -1; #pragma omp parallel for num_threads(CWorkerThreadPool::NumberIdealProcessors()) firstprivate(thread_id)