diff options
| author | practicalswift <[email protected]> | 2019-05-16 11:36:01 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2019-05-17 13:29:04 +0200 |
| commit | de9b5dbca34230b8213ce612036fccabdb6ee53b (patch) | |
| tree | 2abefce0b56e73aad348ddcdeadc740074fbee2b | |
| parent | Move LockAnnotation to make it reflect the truth (diff) | |
| download | discoin-de9b5dbca34230b8213ce612036fccabdb6ee53b.tar.xz discoin-de9b5dbca34230b8213ce612036fccabdb6ee53b.zip | |
Make sure the compile-time locking promises given via LockAnnotation:s hold also in practice at runtime (ifdef DEBUG_LOCKORDER)
| -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 a4c22f67c..43473534d 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() {} }; |