diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2017-11-08 15:28:35 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2018-08-03 07:11:37 -0500 |
commit | 41b88e93375d57db12da923f45f87b9a2db8e730 (patch) | |
tree | ca184f2dbeea04b7deea7f7f3dc5a73d66d51795 /src/sync.h | |
parent | 2b67354aa584c4aabae049a67767ac7b70e2d01a (diff) |
Add unit test for DEBUG_LOCKORDER code
Diffstat (limited to 'src/sync.h')
-rw-r--r-- | src/sync.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sync.h b/src/sync.h index 882ad5dc4c..b8cb84f79f 100644 --- a/src/sync.h +++ b/src/sync.h @@ -77,6 +77,13 @@ std::string LocksHeld(); void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) ASSERT_EXCLUSIVE_LOCK(cs); void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs); void DeleteLock(void* cs); + +/** + * Call abort() if a potential lock order deadlock bug is detected, instead of + * just logging information and throwing a logic_error. Defaults to true, and + * set to false in DEBUG_LOCKORDER unit tests. + */ +extern bool g_debug_lockorder_abort; #else void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) {} void static inline LeaveCritical() {} |