aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-04-07 18:55:29 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-04-09 01:59:57 +0200
commitf342dac1cb06d5b0d264fa59e448ef6477ec5b6b (patch)
treee718ee1c9a8dd355238639a61ebbbba7226918ae /src/util.h
parent908037fe16843aa354f63af8f14804821aaf70f1 (diff)
Do not report spurious deadlocks caused by TRY_LOCK
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.h b/src/util.h
index 7027e62b09..a04ab2c948 100644
--- a/src/util.h
+++ b/src/util.h
@@ -190,10 +190,10 @@ typedef boost::interprocess::interprocess_recursive_mutex CCriticalSection;
typedef boost::interprocess::interprocess_mutex CWaitableCriticalSection;
#ifdef DEBUG_LOCKORDER
-void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs);
+void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false);
void LeaveCritical();
#else
-void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs) {}
+void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) {}
void static inline LeaveCritical() {}
#endif
@@ -234,7 +234,7 @@ public:
{
if (!lock.owns())
{
- EnterCritical(pszName, pszFile, nLine, (void*)(lock.mutex()));
+ EnterCritical(pszName, pszFile, nLine, (void*)(lock.mutex()), true);
lock.try_lock();
if (!lock.owns())
LeaveCritical();