@@ -83,8 +83,6 @@ void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLi
83
83
inline void DeleteLock (void * cs) {}
84
84
inline bool LockStackEmpty () { return true ; }
85
85
#endif
86
- #define AssertLockHeld (cs ) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
87
- #define AssertLockNotHeld (cs ) AssertLockNotHeldInternal(#cs, __FILE__, __LINE__, &cs)
88
86
89
87
/* *
90
88
* Template mixin that adds -Wthread-safety locking annotations and lock order
@@ -129,7 +127,13 @@ class LOCKABLE AnnotatedMixin : public PARENT
129
127
using RecursiveMutex = AnnotatedMixin<std::recursive_mutex>;
130
128
131
129
/* * Wrapped mutex: supports waiting but not recursive locking */
132
- typedef AnnotatedMixin<std::mutex> Mutex;
130
+ using Mutex = AnnotatedMixin<std::mutex>;
131
+
132
+ #define AssertLockHeld (cs ) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
133
+
134
+ inline void AssertLockNotHeldInline (const char * name, const char * file, int line, Mutex* cs) EXCLUSIVE_LOCKS_REQUIRED(!cs) { AssertLockNotHeldInternal (name, file, line, cs); }
135
+ inline void AssertLockNotHeldInline (const char * name, const char * file, int line, RecursiveMutex* cs) LOCKS_EXCLUDED(cs) { AssertLockNotHeldInternal (name, file, line, cs); }
136
+ #define AssertLockNotHeld (cs ) AssertLockNotHeldInline(#cs, __FILE__, __LINE__, &cs)
133
137
134
138
/* * Wrapper around std::unique_lock style lock for Mutex. */
135
139
template <typename Mutex, typename Base = typename Mutex::UniqueLock>
0 commit comments