From 971a468ccf0474ca00fa7d20278569b8fb11f0fb Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 28 May 2020 09:55:04 +0300 Subject: Use template function instead of void* parameter This change gets rid of -Wthread-safety-attributes warning spam. --- src/sync.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sync.cpp') diff --git a/src/sync.cpp b/src/sync.cpp index c3312b5a0..9abdedbed 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -219,12 +219,15 @@ static bool LockHeld(void* mutex) return false; } -void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) +template +void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs) { if (LockHeld(cs)) return; tfm::format(std::cerr, "Assertion failed: lock %s not held in %s:%i; locks held:\n%s", pszName, pszFile, nLine, LocksHeld()); abort(); } +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) { -- cgit v1.2.3