From: Kevin Wolf Date: Wed, 7 Dec 2022 13:18:26 +0000 (+0100) Subject: clang-tsa: Add TSA_ASSERT() macro X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b1cc02e9463a406c6edd7ac55e356cf65a0681d7;p=qemu.git clang-tsa: Add TSA_ASSERT() macro Signed-off-by: Kevin Wolf Message-Id: <20221207131838.239125-7-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- diff --git a/include/qemu/clang-tsa.h b/include/qemu/clang-tsa.h index 0a3361dfc8..211ee0ae73 100644 --- a/include/qemu/clang-tsa.h +++ b/include/qemu/clang-tsa.h @@ -98,4 +98,13 @@ */ #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 */