aboutsummaryrefslogtreecommitdiff
path: root/src/threadsafety.h
diff options
context:
space:
mode:
authorJesse Cohen <jc@jc.lol>2018-06-08 14:06:58 -0400
committerJesse Cohen <jc@jc.lol>2018-07-25 10:31:27 -0400
commitf393a533bebc088985f94c725b9af881500ba998 (patch)
tree106f7fc744b1f3a8c4dfa0b55e9cc88ebdbf0fec /src/threadsafety.h
parent29b4ee64695f79511912ae127e66e0fe82f7a0d1 (diff)
downloadbitcoin-f393a533bebc088985f94c725b9af881500ba998.tar.xz
Annotate AssertLockHeld() with ASSERT_CAPABILITY() for thread safety analysis
Diffstat (limited to 'src/threadsafety.h')
-rw-r--r--src/threadsafety.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/threadsafety.h b/src/threadsafety.h
index 61e63dbc7a..d847269dff 100644
--- a/src/threadsafety.h
+++ b/src/threadsafety.h
@@ -31,6 +31,7 @@
#define EXCLUSIVE_LOCKS_REQUIRED(...) __attribute__((exclusive_locks_required(__VA_ARGS__)))
#define SHARED_LOCKS_REQUIRED(...) __attribute__((shared_locks_required(__VA_ARGS__)))
#define NO_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis))
+#define ASSERT_EXCLUSIVE_LOCK(...) __attribute((assert_exclusive_lock(__VA_ARGS__)))
#else
#define LOCKABLE
#define SCOPED_LOCKABLE
@@ -50,6 +51,7 @@
#define EXCLUSIVE_LOCKS_REQUIRED(...)
#define SHARED_LOCKS_REQUIRED(...)
#define NO_THREAD_SAFETY_ANALYSIS
+#define ASSERT_EXCLUSIVE_LOCK(...)
#endif // __GNUC__
#endif // BITCOIN_THREADSAFETY_H