Skip to content

Commit

Permalink
clang-tsa: Add TSA_ASSERT() macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kevmw committed Dec 14, 2022
1 parent a22640a commit 9471446
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/qemu/clang-tsa.h
Expand Up @@ -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 */

0 comments on commit 9471446

Please sign in to comment.