]> granicus.if.org Git - icinga2/commitdiff
Fix: Compat Log: abort on OwnLock()
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 24 Jun 2013 06:56:13 +0000 (08:56 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 24 Jun 2013 06:56:49 +0000 (08:56 +0200)
Fixes #4332

components/compat/compatlog.cpp

index 20df8965a306fbb15c96128b8108778ee559480d..e7d93dc12a63063acaa7293cd6a8d1cac9fad862 100644 (file)
@@ -156,7 +156,10 @@ void CompatLog::CheckResultRequestHandler(const RequestMessage& request)
               << attempt_after << ";"
               << "";
 
-       WriteLine(msgbuf.str());
+       {
+               ObjectLock olock(this);
+               WriteLine(msgbuf.str());
+       }
 
        if (service == host->GetHostCheckService()) {
                std::ostringstream msgbuf;
@@ -167,10 +170,17 @@ void CompatLog::CheckResultRequestHandler(const RequestMessage& request)
                       << attempt_after << ";"
                       << "";
 
-               WriteLine(msgbuf.str());
+               {
+                       ObjectLock olock(this);
+                       WriteLine(msgbuf.str());
+               }
+
        }
 
-       Flush();
+       {
+               ObjectLock olock(this);
+               Flush();
+       }
 }
 
 void CompatLog::WriteLine(const String& line)