Add missing lock.

This commit is contained in:
Gunnar Beutner 2013-09-12 15:07:37 +02:00
parent 0c64ea7f88
commit 4e54a96880
1 changed files with 7 additions and 0 deletions

View File

@ -1139,6 +1139,7 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c
continue; continue;
if (authorities) { if (authorities) {
ObjectLock olock(authorities);
BOOST_FOREACH(const String& authority, authorities) { BOOST_FOREACH(const String& authority, authorities) {
if (Utility::Match(authority, endpoint->GetName())) { if (Utility::Match(authority, endpoint->GetName())) {
match = true; match = true;
@ -1156,6 +1157,12 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c
std::sort(endpoints.begin(), endpoints.end()); std::sort(endpoints.begin(), endpoints.end());
std::ostringstream msgbuf;
BOOST_FOREACH(const String& name, endpoints) {
msgbuf << name << ", ";
}
Log(LogDebug, "cluster", "Responsible for " + object->GetName() + ": " + msgbuf.str());
String key = object->GetType()->GetName() + "\t" + object->GetName(); String key = object->GetType()->GetName() + "\t" + object->GetName();
unsigned long hash = Utility::SDBM(key); unsigned long hash = Utility::SDBM(key);
unsigned long index = hash % endpoints.size(); unsigned long index = hash % endpoints.size();