Commit 74d2c386 authored by legoc's avatar legoc

Corrected bug: startup was blocking on Fipps

parent b1ac52dd
......@@ -78,16 +78,25 @@ void Condition::verify(const std::string& expression) {
void Condition::init() {
boost::recursive_mutex::scoped_lock lock(_mutex);
// Protect from concurrent access but release the lock after the block.
{
boost::recursive_mutex::scoped_lock lock(_mutex);
_booleanExpression->init();
_booleanExpression->init();
// adding the subscribers
_propertyIDs = _booleanExpression->getPropertyIDs();
}
// adding the subscribers
_propertyIDs = _booleanExpression->getPropertyIDs();
// The lock is released.
for (set<unsigned long>::const_iterator p = _propertyIDs.begin(); p != _propertyIDs.end(); p++) {
// add the subscriber
// Add the subscriber without locking because Condition::propertyChanged can be called in parallel and block.
DataNotificationRouter::getInstance()->addPropertyChangeSubscriber(*p, this);
// Protect _servantIDs.
boost::recursive_mutex::scoped_lock lock(_mutex);
// get the servant ID
_servantIDs.insert(DataAccess::getInstance()->getServantIDFromPropertyID(0, *p));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment