]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
clang-tsa: Add TSA_ASSERT() macro
authorKevin Wolf <kwolf@redhat.com>
Wed, 7 Dec 2022 13:18:26 +0000 (14:18 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 15 Dec 2022 15:07:43 +0000 (16:07 +0100)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20221207131838.239125-7-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
include/qemu/clang-tsa.h

index 0a3361dfc8c9476ab11957ff2efe9d5e29bf40b3..211ee0ae73d55f4ce94e4dfd25edce9ce6b7f947 100644 (file)
  */
 #define TSA_NO_TSA TSA(no_thread_safety_analysis)
 
+/*
+ * TSA_ASSERT() is used to annotate functions: This function will assert that
+ * the lock is held. When it returns, the caller of the function is assumed to
+ * already hold the resource.
+ *
+ * More than one mutex may be specified, comma-separated.
+ */
+#define TSA_ASSERT(...) TSA(assert_capability(__VA_ARGS__))
+
 #endif /* #ifndef CLANG_TSA_H */