[icinga-checkins] icinga.org: icinga2/master: Remove obsolete mutex profiling code

git at icinga.org git at icinga.org
Thu Nov 13 05:47:53 CET 2014


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

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Thu Nov 13 05:47:48 2014 +0100

Remove obsolete mutex profiling code

refs #7622

---

 lib/base/thinmutex.cpp |   27 ---------------------------
 lib/base/thinmutex.hpp |   28 +---------------------------
 2 files changed, 1 insertion(+), 54 deletions(-)

diff --git a/lib/base/thinmutex.cpp b/lib/base/thinmutex.cpp
index 4276b1a..5830218 100644
--- a/lib/base/thinmutex.cpp
+++ b/lib/base/thinmutex.cpp
@@ -18,7 +18,6 @@
  ******************************************************************************/
 
 #include "base/thinmutex.hpp"
-#include "base/initialize.hpp"
 #include "base/timer.hpp"
 #include "base/convert.hpp"
 #include "base/logger.hpp"
@@ -26,32 +25,6 @@
 
 using namespace icinga;
 
-#ifdef _DEBUG
-uintptr_t ThinMutex::m_TotalMutexes;
-uintptr_t ThinMutex::m_InflatedMutexes;
-uintptr_t ThinMutex::m_DeadMutexes;
-
-static Timer::Ptr l_Timer;
-
-void ThinMutex::DebugTimerHandler(void)
-{
-	Log(LogNotice, "ThinMutex")
-	    << "Mutexes: " << ThinMutex::m_TotalMutexes - ThinMutex::m_DeadMutexes
-	    << ", Inflated Mutexes: " << ThinMutex::m_InflatedMutexes
-	    << ", Dead Mutexes: " << ThinMutex::m_DeadMutexes;
-}
-
-static void InitThinMutex(void)
-{
-	l_Timer = new Timer();
-	l_Timer->SetInterval(10);
-	l_Timer->OnTimerExpired.connect(boost::bind(&ThinMutex::DebugTimerHandler));
-	l_Timer->Start();
-}
-
-INITIALIZE_ONCE(&InitThinMutex);
-#endif /* _DEBUG */
-
 void ThinMutex::LockSlowPath(void)
 {
 	LockSlowPath(false);
diff --git a/lib/base/thinmutex.hpp b/lib/base/thinmutex.hpp
index b560f8f..0379f98 100644
--- a/lib/base/thinmutex.hpp
+++ b/lib/base/thinmutex.hpp
@@ -43,28 +43,12 @@ class I2_BASE_API ThinMutex
 public:
 	inline ThinMutex(void)
 		: m_Data(THINLOCK_UNLOCKED)
-	{
-#ifdef _DEBUG
-#	ifdef _WIN32
-		InterlockedIncrement(&m_TotalMutexes);
-#	else /* _WIN32 */
-		__sync_fetch_and_add(&m_TotalMutexes, 1);
-#	endif /* _WIN32 */
-#endif /* _DEBUG */
-	}
+	{ }
 
 	inline ~ThinMutex(void)
 	{
 		if (m_Data > THINLOCK_LOCKED)
 			DestroyNative();
-
-#ifdef _DEBUG
-#	ifdef _WIN32
-		InterlockedDecrement(&m_TotalMutexes);
-#	else /* _WIN32 */
-		__sync_fetch_and_add(&m_DeadMutexes, 1);
-#	endif /* _WIN32 */
-#endif /* _DEBUG */
 	}
 
 	inline void Lock(bool make_native = false)
@@ -105,10 +89,6 @@ public:
 		Unlock();
 	}
 
-#ifdef _DEBUG
-	static void DebugTimerHandler(void);
-#endif /* _DEBUG */
-
 private:
 	inline void Spin(unsigned int it)
 	{
@@ -145,12 +125,6 @@ private:
 #else /* _WIN32 */
 	uintptr_t m_Data;
 #endif /* _WIN32 */
-
-#ifdef _DEBUG
-	static uintptr_t m_TotalMutexes;
-	static uintptr_t m_InflatedMutexes;
-	static uintptr_t m_DeadMutexes;
-#endif /* _DEBUG */
 };
 
 }



More information about the icinga-checkins mailing list