summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorPeter Maydell2020-05-04 21:35:59 +0200
committerPeter Maydell2020-05-04 21:35:59 +0200
commit5c7c46fea9f745956fcc7bea5c3af8380a599ee4 (patch)
tree430973a6470b5f1a7718715d04401b03c4ef201b /include/qemu
parentMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (diff)
parentlockable: Replace locks with lock guard macros (diff)
downloadqemu-5c7c46fea9f745956fcc7bea5c3af8380a599ee4.tar.gz
qemu-5c7c46fea9f745956fcc7bea5c3af8380a599ee4.tar.xz
qemu-5c7c46fea9f745956fcc7bea5c3af8380a599ee4.zip
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request v2: * Fixed stray slirp submodule change [Peter] Fixes for the lock guard macros, code conversions to the lock guard macros, and support for selecting fuzzer targets with argv[0]. # gpg: Signature made Mon 04 May 2020 16:11:11 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: lockable: Replace locks with lock guard macros lockable: replaced locks with lock guard macros where appropriate lockable: fix __COUNTER__ macro to be referenced properly fuzz: select fuzz target using executable name Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/lockable.h7
-rw-r--r--include/qemu/rcu.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/include/qemu/lockable.h b/include/qemu/lockable.h
index 1aeb2cb1a6..b620023141 100644
--- a/include/qemu/lockable.h
+++ b/include/qemu/lockable.h
@@ -152,7 +152,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(QemuLockable, qemu_lockable_auto_unlock)
* }
*/
#define WITH_QEMU_LOCK_GUARD(x) \
- WITH_QEMU_LOCK_GUARD_((x), qemu_lockable_auto##__COUNTER__)
+ WITH_QEMU_LOCK_GUARD_((x), glue(qemu_lockable_auto, __COUNTER__))
/**
* QEMU_LOCK_GUARD - Lock an object until the end of the scope
@@ -169,8 +169,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(QemuLockable, qemu_lockable_auto_unlock)
* return; <-- mutex is automatically unlocked
* }
*/
-#define QEMU_LOCK_GUARD(x) \
- g_autoptr(QemuLockable) qemu_lockable_auto##__COUNTER__ = \
+#define QEMU_LOCK_GUARD(x) \
+ g_autoptr(QemuLockable) \
+ glue(qemu_lockable_auto, __COUNTER__) G_GNUC_UNUSED = \
qemu_lockable_auto_lock(QEMU_MAKE_LOCKABLE((x)))
#endif
diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h
index 9c82683e37..570aa603eb 100644
--- a/include/qemu/rcu.h
+++ b/include/qemu/rcu.h
@@ -170,7 +170,7 @@ static inline void rcu_read_auto_unlock(RCUReadAuto *r)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(RCUReadAuto, rcu_read_auto_unlock)
#define WITH_RCU_READ_LOCK_GUARD() \
- WITH_RCU_READ_LOCK_GUARD_(_rcu_read_auto##__COUNTER__)
+ WITH_RCU_READ_LOCK_GUARD_(glue(_rcu_read_auto, __COUNTER__))
#define WITH_RCU_READ_LOCK_GUARD_(var) \
for (g_autoptr(RCUReadAuto) var = rcu_read_auto_lock(); \