File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -149,12 +149,17 @@ static void push_lock(void* c, const CLockLocation& locklocation)
149149 const LockPair p1 = std::make_pair (i.first , c);
150150 if (lockdata.lockorders .count (p1))
151151 continue ;
152- lockdata.lockorders .emplace (p1, lock_stack);
153152
154153 const LockPair p2 = std::make_pair (c, i.first );
154+ if (lockdata.lockorders .count (p2)) {
155+ auto lock_stack_copy = lock_stack;
156+ lock_stack.pop_back ();
157+ potential_deadlock_detected (p1, lockdata.lockorders [p2], lock_stack_copy);
158+ // potential_deadlock_detected() does not return.
159+ }
160+
161+ lockdata.lockorders .emplace (p1, lock_stack);
155162 lockdata.invlockorders .insert (p2);
156- if (lockdata.lockorders .count (p2))
157- potential_deadlock_detected (p1, lockdata.lockorders [p2], lockdata.lockorders [p1]);
158163 }
159164}
160165
You can’t perform that action at this time.
0 commit comments