diff options
| author | practicalswift <[email protected]> | 2019-05-16 11:25:31 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2019-05-17 13:29:04 +0200 |
| commit | cc2588579c3fbc133a7ca762fa213ca18b736551 (patch) | |
| tree | 08d7d6ec8fd9d73ddd306eca95f9e0609b4d2903 /src/sync.h | |
| parent | Merge #15999: init: Remove dead code in LoadChainTip (diff) | |
| download | discoin-cc2588579c3fbc133a7ca762fa213ca18b736551.tar.xz discoin-cc2588579c3fbc133a7ca762fa213ca18b736551.zip | |
Move LockAnnotation from threadsafety.h (imported code) to sync.h (our code)
Diffstat (limited to 'src/sync.h')
| -rw-r--r-- | src/sync.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sync.h b/src/sync.h index 2667fb52f..a4c22f67c 100644 --- a/src/sync.h +++ b/src/sync.h @@ -304,4 +304,15 @@ public: } }; +// Utility class for indicating to compiler thread analysis that a mutex is +// locked (when it couldn't be determined otherwise). +struct SCOPED_LOCKABLE LockAnnotation +{ + template <typename Mutex> + explicit LockAnnotation(Mutex& mutex) EXCLUSIVE_LOCK_FUNCTION(mutex) + { + } + ~LockAnnotation() UNLOCK_FUNCTION() {} +}; + #endif // BITCOIN_SYNC_H |