From 41b88e93375d57db12da923f45f87b9a2db8e730 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Wed, 8 Nov 2017 15:28:35 -0500 Subject: Add unit test for DEBUG_LOCKORDER code --- src/sync.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/sync.h') 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() {} -- cgit v1.2.3