@@ -77,52 +77,28 @@ boost::thread_specific_ptr<LockStack> lockstack;
77
77
78
78
static void potential_deadlock_detected (const std::pair<void *, void *>& mismatch, const LockStack& s1, const LockStack& s2)
79
79
{
80
- // We attempt to not assert on probably-not deadlocks by assuming that
81
- // a try lock will immediately have otherwise bailed if it had
82
- // failed to get the lock
83
- // We do this by, for the locks which triggered the potential deadlock,
84
- // in either lockorder, checking that the second of the two which is locked
85
- // is only a TRY_LOCK, ignoring locks if they are reentrant.
86
- bool firstLocked = false ;
87
- bool secondLocked = false ;
88
- bool onlyMaybeDeadlock = false ;
89
-
90
80
LogPrintf (" POTENTIAL DEADLOCK DETECTED\n " );
91
81
LogPrintf (" Previous lock order was:\n " );
92
82
BOOST_FOREACH (const PAIRTYPE (void *, CLockLocation) & i, s2) {
93
83
if (i.first == mismatch.first ) {
94
84
LogPrintf (" (1)" );
95
- if (!firstLocked && secondLocked && i.second .fTry )
96
- onlyMaybeDeadlock = true ;
97
- firstLocked = true ;
98
85
}
99
86
if (i.first == mismatch.second ) {
100
87
LogPrintf (" (2)" );
101
- if (!secondLocked && firstLocked && i.second .fTry )
102
- onlyMaybeDeadlock = true ;
103
- secondLocked = true ;
104
88
}
105
89
LogPrintf (" %s\n " , i.second .ToString ());
106
90
}
107
- firstLocked = false ;
108
- secondLocked = false ;
109
91
LogPrintf (" Current lock order is:\n " );
110
92
BOOST_FOREACH (const PAIRTYPE (void *, CLockLocation) & i, s1) {
111
93
if (i.first == mismatch.first ) {
112
94
LogPrintf (" (1)" );
113
- if (!firstLocked && secondLocked && i.second .fTry )
114
- onlyMaybeDeadlock = true ;
115
- firstLocked = true ;
116
95
}
117
96
if (i.first == mismatch.second ) {
118
97
LogPrintf (" (2)" );
119
- if (!secondLocked && firstLocked && i.second .fTry )
120
- onlyMaybeDeadlock = true ;
121
- secondLocked = true ;
122
98
}
123
99
LogPrintf (" %s\n " , i.second .ToString ());
124
100
}
125
- assert (onlyMaybeDeadlock );
101
+ assert (false );
126
102
}
127
103
128
104
static void push_lock (void * c, const CLockLocation& locklocation, bool fTry )
0 commit comments