mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
sync.h: Make runtime lock checks require compile-time lock checks
This commit is contained in:
parent
23d71d171e
commit
2ee7743fe7
4 changed files with 12 additions and 7 deletions
|
|
@ -238,12 +238,15 @@ void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine,
|
|||
template void AssertLockHeldInternal(const char*, const char*, int, Mutex*);
|
||||
template void AssertLockHeldInternal(const char*, const char*, int, RecursiveMutex*);
|
||||
|
||||
void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs)
|
||||
template <typename MutexType>
|
||||
void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs)
|
||||
{
|
||||
if (!LockHeld(cs)) return;
|
||||
tfm::format(std::cerr, "Assertion failed: lock %s held in %s:%i; locks held:\n%s", pszName, pszFile, nLine, LocksHeld());
|
||||
abort();
|
||||
}
|
||||
template void AssertLockNotHeldInternal(const char*, const char*, int, Mutex*);
|
||||
template void AssertLockNotHeldInternal(const char*, const char*, int, RecursiveMutex*);
|
||||
|
||||
void DeleteLock(void* cs)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue