[icinga-checkins] icinga.org: icinga2/master: Fix: Compat Log: abort on OwnLock()

git at icinga.org git at icinga.org
Mon Jun 24 08:57:04 CEST 2013


Module: icinga2
Branch: master
Commit: ea0052f208e35d6de1477a8f0e689e919160b917
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=ea0052f208e35d6de1477a8f0e689e919160b917

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Mon Jun 24 08:56:13 2013 +0200

Fix: Compat Log: abort on OwnLock()

Fixes #4332

---

 components/compat/compatlog.cpp |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/components/compat/compatlog.cpp b/components/compat/compatlog.cpp
index 20df896..e7d93dc 100644
--- a/components/compat/compatlog.cpp
+++ b/components/compat/compatlog.cpp
@@ -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)





More information about the icinga-checkins mailing list