[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/18] clang-tsa: Add macros for shared locks
From: |
Kevin Wolf |
Subject: |
[PATCH 07/18] clang-tsa: Add macros for shared locks |
Date: |
Wed, 7 Dec 2022 14:18:27 +0100 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
include/qemu/clang-tsa.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/qemu/clang-tsa.h b/include/qemu/clang-tsa.h
index 211ee0ae73..ba06fb8c92 100644
--- a/include/qemu/clang-tsa.h
+++ b/include/qemu/clang-tsa.h
@@ -62,6 +62,7 @@
* void Foo(void) TSA_REQUIRES(mutex);
*/
#define TSA_REQUIRES(...) TSA(requires_capability(__VA_ARGS__))
+#define TSA_REQUIRES_SHARED(...) TSA(requires_shared_capability(__VA_ARGS__))
/* TSA_EXCLUDES() is used to annotate functions: the caller of the
* function MUST NOT hold resource, the function first acquires the
@@ -82,6 +83,7 @@
* void Foo(void) TSA_ACQUIRE(mutex);
*/
#define TSA_ACQUIRE(...) TSA(acquire_capability(__VA_ARGS__))
+#define TSA_ACQUIRE_SHARED(...) TSA(acquire_shared_capability(__VA_ARGS__))
/* TSA_RELEASE() is used to annotate functions: the caller of the
* function MUST hold the resource, but the function will then release it.
@@ -91,6 +93,7 @@
* void Foo(void) TSA_RELEASE(mutex);
*/
#define TSA_RELEASE(...) TSA(release_capability(__VA_ARGS__))
+#define TSA_RELEASE_SHARED(...) TSA(release_shared_capability(__VA_ARGS__))
/* TSA_NO_TSA is used to annotate functions. Use only when you need to.
*
@@ -106,5 +109,6 @@
* More than one mutex may be specified, comma-separated.
*/
#define TSA_ASSERT(...) TSA(assert_capability(__VA_ARGS__))
+#define TSA_ASSERT_SHARED(...) TSA(assert_shared_capability(__VA_ARGS__))
#endif /* #ifndef CLANG_TSA_H */
--
2.38.1
- [PATCH 00/18] block: Introduce a block graph rwlock, Kevin Wolf, 2022/12/07
- [PATCH 01/18] block: Factor out bdrv_drain_all_begin_nopoll(), Kevin Wolf, 2022/12/07
- [PATCH 02/18] graph-lock: Introduce a lock to protect block graph operations, Kevin Wolf, 2022/12/07
- [PATCH 03/18] graph-lock: Implement guard macros, Kevin Wolf, 2022/12/07
- [PATCH 04/18] async: Register/unregister aiocontext in graph lock list, Kevin Wolf, 2022/12/07
- [PATCH 05/18] Import clang-tsa.h, Kevin Wolf, 2022/12/07
- [PATCH 07/18] clang-tsa: Add macros for shared locks,
Kevin Wolf <=
- [PATCH 08/18] configure: Enable -Wthread-safety if present, Kevin Wolf, 2022/12/07
- [PATCH 10/18] block: Fix locking in external_snapshot_prepare(), Kevin Wolf, 2022/12/07
- [PATCH 12/18] block: remove unnecessary assert_bdrv_graph_writable(), Kevin Wolf, 2022/12/07
- [PATCH 11/18] block: wrlock in bdrv_replace_child_noperm, Kevin Wolf, 2022/12/07
- [PATCH 06/18] clang-tsa: Add TSA_ASSERT() macro, Kevin Wolf, 2022/12/07
- [PATCH 14/18] graph-lock: TSA annotations for lock/unlock functions, Kevin Wolf, 2022/12/07
- [PATCH 13/18] block: assert that graph read and writes are performed correctly, Kevin Wolf, 2022/12/07
- [PATCH 16/18] block-coroutine-wrapper.py: introduce annotations that take the graph rdlock, Kevin Wolf, 2022/12/07
- [PATCH 15/18] Mark assert_bdrv_graph_readable/writable() GRAPH_RD/WRLOCK, Kevin Wolf, 2022/12/07
- [PATCH 17/18] block: use co_wrapper_mixed_bdrv_rdlock in functions taking the rdlock, Kevin Wolf, 2022/12/07