mutex debugging routines: LocksHeld() and AssertLockHeld()

This commit is contained in:
Gavin Andresen
2013-11-29 17:25:30 +10:00
parent 207cfbfbf1
commit c649637b6c
3 changed files with 23 additions and 0 deletions

View File

@@ -87,9 +87,12 @@ typedef AnnotatedMixin<boost::mutex> CWaitableCriticalSection;
#ifdef DEBUG_LOCKORDER
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);
#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) {}
#endif
#ifdef DEBUG_LOCKCONTENTION