From ea57f0045e4ade0d5dc264637eaf095a2b91e67b Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 12 Jul 2016 11:44:36 +0200 Subject: [PATCH] Fix deadlock in DbObject::SendVars{Config,Status}Update fixes #12127 fixes #12085 --- lib/db_ido/dbobject.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/db_ido/dbobject.cpp b/lib/db_ido/dbobject.cpp index 1b85b606c..471bd426b 100644 --- a/lib/db_ido/dbobject.cpp +++ b/lib/db_ido/dbobject.cpp @@ -161,6 +161,7 @@ void DbObject::SendVarsConfigUpdate(void) Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object); if (vars) { + std::vector queries; ObjectLock olock (vars); BOOST_FOREACH(const Dictionary::Pair& kv, vars) { @@ -196,8 +197,10 @@ void DbObject::SendVarsConfigUpdate(void) query.WhereCriteria->Set("varname", kv.first); query.Object = this; - OnQuery(query); + queries.push_back(query); } + + OnMultipleQueries(queries); } } @@ -213,6 +216,7 @@ void DbObject::SendVarsStatusUpdate(void) Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object); if (vars) { + std::vector queries; ObjectLock olock (vars); BOOST_FOREACH(const Dictionary::Pair& kv, vars) { @@ -248,8 +252,10 @@ void DbObject::SendVarsStatusUpdate(void) query.WhereCriteria->Set("varname", kv.first); query.Object = this; - OnQuery(query); + queries.push_back(query); } + + OnMultipleQueries(queries); } } -- 2.40.0