aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-02-07 14:15:28 -0500
committerMatt Corallo <git@bluematt.me>2017-02-07 14:15:28 -0500
commit618ee9249b178d94911ea66cb4b5291f000ef1fb (patch)
treedde47fee6a3afbdd91f54b35173e25812509de87 /src
parent2a962d4540a253f63803d1f145fa26b938e69633 (diff)
Further-enforce lockordering by enforcing directly after TRY_LOCKs
Diffstat (limited to 'src')
-rw-r--r--src/sync.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/sync.cpp b/src/sync.cpp
index 25773f08e9..fce57f1df9 100644
--- a/src/sync.cpp
+++ b/src/sync.cpp
@@ -110,21 +110,19 @@ static void push_lock(void* c, const CLockLocation& locklocation, bool fTry)
(*lockstack).push_back(std::make_pair(c, locklocation));
- if (!fTry) {
- BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, (*lockstack)) {
- if (i.first == c)
- break;
-
- std::pair<void*, void*> p1 = std::make_pair(i.first, c);
- if (lockdata.lockorders.count(p1))
- continue;
- lockdata.lockorders[p1] = (*lockstack);
-
- std::pair<void*, void*> p2 = std::make_pair(c, i.first);
- lockdata.invlockorders.insert(p2);
- if (lockdata.lockorders.count(p2))
- potential_deadlock_detected(p1, lockdata.lockorders[p2], lockdata.lockorders[p1]);
- }
+ BOOST_FOREACH (const PAIRTYPE(void*, CLockLocation) & i, (*lockstack)) {
+ if (i.first == c)
+ break;
+
+ std::pair<void*, void*> p1 = std::make_pair(i.first, c);
+ if (lockdata.lockorders.count(p1))
+ continue;
+ lockdata.lockorders[p1] = (*lockstack);
+
+ std::pair<void*, void*> p2 = std::make_pair(c, i.first);
+ lockdata.invlockorders.insert(p2);
+ if (lockdata.lockorders.count(p2))
+ potential_deadlock_detected(p1, lockdata.lockorders[p2], lockdata.lockorders[p1]);
}
}