From 31dacb8390e9a651edbf0bb96a4a80839e1b26fd Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 8 Mar 2021 18:11:24 +0100 Subject: [PATCH] IcingaDB#UpdateAllConfigObjects(): don't modify map concurrently --- lib/icingadb/icingadb-objects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index af11685e9..4d7e2f9f3 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -367,9 +367,9 @@ void IcingaDB::UpdateAllConfigObjects() std::map> ourContent; for (auto& source : ourContentRaw) { - upqObjectType.Enqueue([&]() { - auto& dest (ourContent[source.first]); + auto& dest (ourContent[source.first]); + upqObjectType.Enqueue([&]() { for (auto& hMSet : source.second) { for (decltype(hMSet.size()) i = 0, stop = hMSet.size() - 1u; i < stop; i += 2u) { dest.emplace(std::move(hMSet[i]), std::move(hMSet[i + 1u]));