mirror of https://github.com/Icinga/icinga2.git
Fix: Add missing locks.
This commit is contained in:
parent
ec0a32380e
commit
98e20f6425
|
@ -49,6 +49,8 @@ void Host::Start(void)
|
|||
Array::Ptr groups = GetGroups();
|
||||
|
||||
if (groups) {
|
||||
ObjectLock olock(groups);
|
||||
|
||||
BOOST_FOREACH(const String& name, groups) {
|
||||
HostGroup::Ptr hg = HostGroup::GetByName(name);
|
||||
|
||||
|
@ -70,6 +72,8 @@ void Host::Stop(void)
|
|||
Array::Ptr groups = GetGroups();
|
||||
|
||||
if (groups) {
|
||||
ObjectLock olock(groups);
|
||||
|
||||
BOOST_FOREACH(const String& name, groups) {
|
||||
HostGroup::Ptr hg = HostGroup::GetByName(name);
|
||||
|
||||
|
|
|
@ -58,6 +58,8 @@ void Service::OnConfigLoaded(void)
|
|||
Array::Ptr groups = GetGroups();
|
||||
|
||||
if (groups) {
|
||||
ObjectLock olock(groups);
|
||||
|
||||
BOOST_FOREACH(const String& name, groups) {
|
||||
ServiceGroup::Ptr sg = ServiceGroup::GetByName(name);
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "icinga/usergroup.h"
|
||||
#include "base/dynamictype.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/objectlock.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
@ -32,6 +33,8 @@ void User::OnConfigLoaded(void)
|
|||
Array::Ptr groups = GetGroups();
|
||||
|
||||
if (groups) {
|
||||
ObjectLock olock(groups);
|
||||
|
||||
BOOST_FOREACH(const String& name, groups) {
|
||||
UserGroup::Ptr ug = UserGroup::GetByName(name);
|
||||
|
||||
|
@ -48,6 +51,8 @@ void User::Stop(void)
|
|||
Array::Ptr groups = GetGroups();
|
||||
|
||||
if (groups) {
|
||||
ObjectLock olock(groups);
|
||||
|
||||
BOOST_FOREACH(const String& name, groups) {
|
||||
UserGroup::Ptr ug = UserGroup::GetByName(name);
|
||||
|
||||
|
|
Loading…
Reference in New Issue