diff options
author | Matt Corallo <matt@bluematt.me> | 2012-06-05 16:12:32 +0200 |
---|---|---|
committer | Matt Corallo <matt@bluematt.me> | 2012-06-05 16:13:16 +0200 |
commit | 4d009243cbc2dd5aa172fedbd00c6658ae6ac82d (patch) | |
tree | 59ae91faa0a7687c29c9c063976573ae6dc6d7fe /src/sync.h | |
parent | 45268208aec6630331238009a5758a2ff228b383 (diff) |
Fix DEBUG_LOCKCONTENTION
Diffstat (limited to 'src/sync.h')
-rw-r--r-- | src/sync.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sync.h b/src/sync.h index dffe4f6ee8..98640e6eab 100644 --- a/src/sync.h +++ b/src/sync.h @@ -27,6 +27,10 @@ void static inline EnterCritical(const char* pszName, const char* pszFile, int n void static inline LeaveCritical() {} #endif +#ifdef DEBUG_LOCKCONTENTION +void PrintLockContention(const char* pszName, const char* pszFile, int nLine); +#endif + /** Wrapper around boost::interprocess::scoped_lock */ template<typename Mutex> class CMutexLock @@ -43,8 +47,7 @@ public: #ifdef DEBUG_LOCKCONTENTION if (!lock.try_lock()) { - printf("LOCKCONTENTION: %s\n", pszName); - printf("Locker: %s:%d\n", pszFile, nLine); + PrintLockContention(pszName, pszFile, nLine); #endif lock.lock(); #ifdef DEBUG_LOCKCONTENTION |