Changeset View
Changeset View
Standalone View
Standalone View
src/sync.cpp
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | void AssertLockHeldInternal(const char *pszName, const char *pszFile, int nLine, | ||||
void *cs) { | void *cs) { | ||||
for (const std::pair<void *, CLockLocation> &i : g_lockstack) { | for (const std::pair<void *, CLockLocation> &i : g_lockstack) { | ||||
if (i.first == cs) { | if (i.first == cs) { | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
tfm::format(std::cerr, | tfm::format(std::cerr, | ||||
"Assertion failed: lock %s not held in %s:%i; locks held:\n%s", | "Assertion failed: lock %s not held in %s:%i; locks held:\n%s", | ||||
pszName, pszFile, nLine, LocksHeld().c_str()); | pszName, pszFile, nLine, LocksHeld()); | ||||
abort(); | abort(); | ||||
} | } | ||||
void AssertLockNotHeldInternal(const char *pszName, const char *pszFile, | void AssertLockNotHeldInternal(const char *pszName, const char *pszFile, | ||||
int nLine, void *cs) { | int nLine, void *cs) { | ||||
for (const std::pair<void *, CLockLocation> &i : g_lockstack) { | for (const std::pair<void *, CLockLocation> &i : g_lockstack) { | ||||
if (i.first == cs) { | if (i.first == cs) { | ||||
tfm::format( | tfm::format( | ||||
std::cerr, | std::cerr, | ||||
"Assertion failed: lock %s held in %s:%i; locks held:\n%s", | "Assertion failed: lock %s held in %s:%i; locks held:\n%s", | ||||
pszName, pszFile, nLine, LocksHeld().c_str()); | pszName, pszFile, nLine, LocksHeld()); | ||||
abort(); | abort(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void DeleteLock(void *cs) { | void DeleteLock(void *cs) { | ||||
LockData &lockdata = GetLockData(); | LockData &lockdata = GetLockData(); | ||||
if (!lockdata.available) { | if (!lockdata.available) { | ||||
Show All 25 Lines |