Changeset View
Changeset View
Standalone View
Standalone View
src/sync.cpp
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | for (const std::pair<void *, CLockLocation> &i : *lockstack) { | ||||
if (i.first == cs) return; | if (i.first == cs) return; | ||||
} | } | ||||
fprintf(stderr, | fprintf(stderr, | ||||
"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().c_str()); | ||||
abort(); | abort(); | ||||
} | } | ||||
void AssertLockNotHeldInternal(const char *pszName, const char *pszFile, | |||||
int nLine, void *cs) { | |||||
for (const std::pair<void *, CLockLocation> &i : *lockstack) { | |||||
if (i.first == cs) { | |||||
fprintf(stderr, | |||||
"Assertion failed: lock %s held in %s:%i; locks held:\n%s", | |||||
pszName, pszFile, nLine, LocksHeld().c_str()); | |||||
abort(); | |||||
} | |||||
} | |||||
} | |||||
void DeleteLock(void *cs) { | void DeleteLock(void *cs) { | ||||
if (!lockdata.available) { | if (!lockdata.available) { | ||||
// We're already shutting down. | // We're already shutting down. | ||||
return; | return; | ||||
} | } | ||||
std::lock_guard<std::mutex> lock(lockdata.dd_mutex); | std::lock_guard<std::mutex> lock(lockdata.dd_mutex); | ||||
std::pair<void *, void *> item = std::make_pair(cs, nullptr); | std::pair<void *, void *> item = std::make_pair(cs, nullptr); | ||||
Show All 17 Lines |