Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/37#discussion_r98902595
  
    --- Diff: libminifi/src/Processor.cpp ---
    @@ -206,6 +207,29 @@ bool Processor::getProperty(std::string name, 
std::string &value)
        }
     }
     
    +bool Processor::getDynamicProperty(std::string name, std::string &value)
    +{
    +   if (isRunning())
    +           // Because set property only allowed in non running state, we 
need to obtain lock avoid rack condition
    +           _mtx.lock();
    +
    +   std::map<std::string, Property>::iterator it = 
_dynamicProperties.find(name);
    +   if (it != _dynamicProperties.end())
    +   {
    +           Property item = it->second;
    +           value = item.getValue();
    +           if (!isRunning())
    +                   _mtx.unlock();
    +           return true;
    +   }
    +   else
    +   {
    +           if (!isRunning())
    --- End diff --
    
    I'm new to this, so forgive the question, but why only unlock when it is 
not running if the above conditional works  only when it is running? This would 
imply the mutex is locked when you are running. I likely missed something, 
though. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to