Bitcoin ABC 0.26.3
P2P Digital Currency
|
Different type to mark Mutex at global scope. More...
#include <sync.h>
Additional Inherited Members | |
Public Types inherited from AnnotatedMixin< std::mutex > | |
using | UniqueLock = std::unique_lock< std::mutex > |
Public Member Functions inherited from AnnotatedMixin< std::mutex > | |
~AnnotatedMixin () | |
void | lock () EXCLUSIVE_LOCK_FUNCTION() |
void | unlock () UNLOCK_FUNCTION() |
bool | try_lock () EXCLUSIVE_TRYLOCK_FUNCTION(true) |
Different type to mark Mutex at global scope.
Thread safety analysis can't handle negative assertions about mutexes with global scope well, so mark them with a separate type, and eventually move all the mutexes into classes so they are not globally visible.
See: https://github.com/bitcoin/bitcoin/pull/20272#issuecomment-720755781