Make sure the compile-time locking promises given via LockAnnotation:s hold also in practice at runtime (ifdef DEBUG_LOCKORDER)

This commit is contained in:
practicalswift 2019-05-16 11:36:01 +02:00
parent 3a809446b3
commit de9b5dbca3

View file

@ -311,6 +311,9 @@ struct SCOPED_LOCKABLE LockAnnotation
template <typename Mutex>
explicit LockAnnotation(Mutex& mutex) EXCLUSIVE_LOCK_FUNCTION(mutex)
{
#ifdef DEBUG_LOCKORDER
AssertLockHeld(mutex);
#endif
}
~LockAnnotation() UNLOCK_FUNCTION() {}
};