From 19a5676280370148492cf59a5103584cf37893ac Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 19 Dec 2013 09:09:51 +0100 Subject: Use mutex pointer instead of name for AssertLockHeld This makes it useable for non-global locks such as the wallet and keystore locks. --- src/sync.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sync.h') diff --git a/src/sync.h b/src/sync.h index c50abf81b6..077ed59b89 100644 --- a/src/sync.h +++ b/src/sync.h @@ -88,12 +88,13 @@ typedef AnnotatedMixin CWaitableCriticalSection; void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false); void LeaveCritical(); std::string LocksHeld(); -void AssertLockHeld(std::string strName); +void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void *cs); #else void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) {} void static inline LeaveCritical() {} -void static inline AssertLockHeld(std::string) {} +void static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void *cs) {} #endif +#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs) #ifdef DEBUG_LOCKCONTENTION void PrintLockContention(const char* pszName, const char* pszFile, int nLine); -- cgit v1.2.3