|
|
|
@ -42,6 +42,8 @@ struct CLockLocation
@@ -42,6 +42,8 @@ struct CLockLocation
|
|
|
|
|
return mutexName+" "+sourceFile+":"+itostr(sourceLine); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string MutexName() const { return mutexName; } |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
std::string mutexName; |
|
|
|
|
std::string sourceFile; |
|
|
|
@ -126,4 +128,20 @@ void LeaveCritical()
@@ -126,4 +128,20 @@ void LeaveCritical()
|
|
|
|
|
pop_lock(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string LocksHeld() |
|
|
|
|
{ |
|
|
|
|
std::string result; |
|
|
|
|
BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)&i, *lockstack) |
|
|
|
|
result += i.second.ToString() + std::string("\n"); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AssertLockHeld(std::string strName) |
|
|
|
|
{ |
|
|
|
|
BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)&i, *lockstack) |
|
|
|
|
if (i.second.MutexName() == strName) return; |
|
|
|
|
LogPrintf("Lock %s not held; locks held:\n%s", strName.c_str(), LocksHeld().c_str()); |
|
|
|
|
assert(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif /* DEBUG_LOCKORDER */ |
|
|
|
|