diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-04-07 18:55:29 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-04-09 01:59:57 +0200 |
commit | f342dac1cb06d5b0d264fa59e448ef6477ec5b6b (patch) | |
tree | e718ee1c9a8dd355238639a61ebbbba7226918ae /src/util.cpp | |
parent | 908037fe16843aa354f63af8f14804821aaf70f1 (diff) |
Do not report spurious deadlocks caused by TRY_LOCK
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util.cpp b/src/util.cpp index 17442a3bcf..affca341ce 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1141,7 +1141,7 @@ static void potential_deadlock_detected(const std::pair<void*, void*>& mismatch, } } -static void push_lock(void* c, const CLockLocation& locklocation) +static void push_lock(void* c, const CLockLocation& locklocation, bool fTry) { bool fOrderOK = true; if (lockstack.get() == NULL) @@ -1152,7 +1152,7 @@ static void push_lock(void* c, const CLockLocation& locklocation) (*lockstack).push_back(std::make_pair(c, locklocation)); - BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, (*lockstack)) + if (!fTry) BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)& i, (*lockstack)) { if (i.first == c) break; @@ -1183,9 +1183,9 @@ static void pop_lock() dd_mutex.unlock(); } -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) { - push_lock(cs, CLockLocation(pszName, pszFile, nLine)); + push_lock(cs, CLockLocation(pszName, pszFile, nLine), fTry); } void LeaveCritical() |