diff options
| author | Matt Corallo <[email protected]> | 2017-01-17 17:42:46 -0500 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-10-13 19:29:54 -0400 |
| commit | 2b4b34503ff0ed44365d83a68ffed2736ea9cc51 (patch) | |
| tree | 62462c66263e297f19d6b1de7a24f91acfab8093 /src/sync.h | |
| parent | Call TransactionRemovedFromMempool in the CScheduler thread (diff) | |
| download | discoin-2b4b34503ff0ed44365d83a68ffed2736ea9cc51.tar.xz discoin-2b4b34503ff0ed44365d83a68ffed2736ea9cc51.zip | |
Add ability to assert a lock is not held in DEBUG_LOCKORDER
Diffstat (limited to 'src/sync.h')
| -rw-r--r-- | src/sync.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sync.h b/src/sync.h index 0871c5fb4..2790fc6f2 100644 --- a/src/sync.h +++ b/src/sync.h @@ -75,14 +75,17 @@ void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs void LeaveCritical(); std::string LocksHeld(); void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs); +void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs); void DeleteLock(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 AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) {} +void static inline AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) {} void static inline DeleteLock(void* cs) {} #endif #define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs) +#define AssertLockNotHeld(cs) AssertLockNotHeldInternal(#cs, __FILE__, __LINE__, &cs) /** * Wrapped boost mutex: supports recursive locking, but no waiting |