szaszm commented on code in PR #1908:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1908#discussion_r1897445945


##########
libminifi/src/core/state/nodes/ResponseNodeLoader.cpp:
##########
@@ -238,6 +242,10 @@ std::vector<SharedResponseNode> 
ResponseNodeLoader::loadResponseNodes(const std:
   }
 
   for (const auto& response_node : response_nodes) {
+    std::lock_guard<std::mutex> guard(initialization_mutex_);

Review Comment:
   Please move the lock guard outside of the loop. Letting go and reacquiring 
the same mutex leads to scheduling inefficiencies if there is any contention.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to