}
String id = Utility::NewUniqueID();
- comments->Set(id, comment);
- Touch("comments");
+ {
+ ObjectLock olock(this);
+
+ comments->Set(id, comment);
+ Touch("comments");
+ }
return id;
}
Dictionary::Ptr comments = owner->GetComments();
if (comments) {
+ ObjectLock olock(owner);
+
comments->Remove(id);
owner->Touch("comments");
}
legacy_id = l_NextCommentID++;
comment->Set("legacy_id", legacy_id);
- service->Touch("comments");
+
+ {
+ ObjectLock olock(service);
+ service->Touch("comments");
+ }
}
newLegacyCommentsCache[legacy_id] = id;
comments->Remove(id);
}
+ ObjectLock olock(this);
Touch("comments");
}
}
Dictionary::Ptr otherDowntimes = otherOwner->Get("downtimes");
Dictionary::Ptr otherDowntime = otherDowntimes->Get(triggeredBy);
Dictionary::Ptr triggers = otherDowntime->Get("triggers");
- triggers->Set(triggeredBy, triggeredBy);
- otherOwner->Touch("downtimes");
+
+ {
+ ObjectLock olock(otherOwner);
+ triggers->Set(triggeredBy, triggeredBy);
+ otherOwner->Touch("downtimes");
+ }
}
Dictionary::Ptr downtimes;
String id = Utility::NewUniqueID();
downtimes->Set(id, downtime);
- Touch("downtimes");
+ {
+ ObjectLock olock(this);
+ Touch("downtimes");
+ }
+
+ (void) AddComment(CommentDowntime, author, comment, endTime);
return id;
}
if (!downtimes)
return;
- downtimes->Remove(id);
- owner->Touch("downtimes");
+ {
+ ObjectLock olock(owner);
+ downtimes->Remove(id);
+ owner->Touch("downtimes");
+ }
}
void Service::TriggerDowntimes(void)