diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2019-05-16 11:36:01 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2019-05-17 13:29:04 +0200 |
commit | de9b5dbca34230b8213ce612036fccabdb6ee53b (patch) | |
tree | 2abefce0b56e73aad348ddcdeadc740074fbee2b /src | |
parent | 3a809446b3881e1a6853da78cccf42643c9a5927 (diff) |
Make sure the compile-time locking promises given via LockAnnotation:s hold also in practice at runtime (ifdef DEBUG_LOCKORDER)
Diffstat (limited to 'src')
-rw-r--r-- | src/sync.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sync.h b/src/sync.h index a4c22f67cc..43473534db 100644 --- a/src/sync.h +++ b/src/sync.h @@ -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() {} }; |