arpadboda commented on a change in pull request #677: MINIFICPP-1065 - Fix UUID 
generation uniqueness and thread safety
URL: https://github.com/apache/nifi-minifi-cpp/pull/677#discussion_r344201154
 
 

 ##########
 File path: libminifi/src/utils/Id.cpp
 ##########
 @@ -215,6 +278,23 @@ void IdGenerator::initialize(const 
std::shared_ptr<Properties> & properties) {
   }
 }
 
+#ifndef WIN32
+bool IdGenerator::generateWithUuidImpl(unsigned int mode, UUID_FIELD output) {
+  void* uuid = nullptr;
+  try {
+    std::lock_guard<std::mutex> lock(uuid_mutex_);
+    uuid_impl_->make(mode);
+    uuid = uuid_impl_->binary();
+  } catch (...){
+    return false;
 
 Review comment:
   As IdGenerator has a logger, I would appreciate logging in case we failed to 
generate unique ID. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to