aboutsummaryrefslogtreecommitdiff
path: root/src/sync.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-07-26 17:19:07 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-07-26 19:13:56 +0200
commitf58674a20a127f104409e11c5c11591533ddf360 (patch)
treeedbc0723c962bec6b990028973bbbee9438b4980 /src/sync.h
parent415f2bff69985a9238d75f380db4c26dda47ca53 (diff)
parent1e3bcd251768baeb95e555d51d2dc787a6b2acee (diff)
downloadbitcoin-f58674a20a127f104409e11c5c11591533ddf360.tar.xz
Merge #13423: [net] Thread safety annotations in net_processing
1e3bcd251768baeb95e555d51d2dc787a6b2acee [net_processing] Add thread safety annotations (Jesse Cohen) f393a533bebc088985f94c725b9af881500ba998 Annotate AssertLockHeld() with ASSERT_CAPABILITY() for thread safety analysis (Jesse Cohen) Pull request description: (note that this depends on #13417) This commit fully annotates all globals in net_processing with clang thread safety annotations. Subsequent commits will begin transitioning some of this data away from cs_main into locks that are local to net_processing. Static thread safety analysis should it easier to verify correctness of that process. Tree-SHA512: b47aa410cb9ada21072370176aea9a74c575643fa1ee8cf1d43c8e28675eef17f33e5242ac422f840e8178e132ecb58412034c6334b68f1b57c686df80d4e8e2
Diffstat (limited to 'src/sync.h')
-rw-r--r--src/sync.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sync.h b/src/sync.h
index 3c451af376..882ad5dc4c 100644
--- a/src/sync.h
+++ b/src/sync.h
@@ -74,13 +74,13 @@ public:
void EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false);
void LeaveCritical();
std::string LocksHeld();
-void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs);
+void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) ASSERT_EXCLUSIVE_LOCK(cs);
void AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs);
void DeleteLock(void* cs);
#else
void static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) {}
void static inline LeaveCritical() {}
-void static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) {}
+void static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) ASSERT_EXCLUSIVE_LOCK(cs) {}
void static inline AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) {}
void static inline DeleteLock(void* cs) {}
#endif