summaryrefslogtreecommitdiffstats
path: root/include/qemu/thread-posix.h
diff options
context:
space:
mode:
authorPeter Maydell2021-06-17 11:42:57 +0200
committerPeter Maydell2021-06-17 11:42:57 +0200
commit18e53dff939898c6dd00d206a3c2f5cd3d6669db (patch)
tree612ff698fdf3d3032f8aecfe98b35abd870cb27f /include/qemu/thread-posix.h
parentMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210616'... (diff)
parentconfigure: Remove probe for _Static_assert (diff)
downloadqemu-18e53dff939898c6dd00d206a3c2f5cd3d6669db.tar.gz
qemu-18e53dff939898c6dd00d206a3c2f5cd3d6669db.tar.xz
qemu-18e53dff939898c6dd00d206a3c2f5cd3d6669db.zip
Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-c11-20210615' into staging
Change to -std=gnu11. Replace QEMU_GENERIC with _Generic. Remove configure detect of _Static_assert. # gpg: Signature made Wed 16 Jun 2021 02:32:32 BST # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth-gitlab/tags/pull-c11-20210615: configure: Remove probe for _Static_assert qemu/compiler: Remove QEMU_GENERIC include/qemu/lockable: Use _Generic instead of QEMU_GENERIC util: Use unique type for QemuRecMutex in thread-posix.h util: Pass file+line to qemu_rec_mutex_unlock_impl util: Use real functions for thread-posix QemuRecMutex softfloat: Use _Generic instead of QEMU_GENERIC configure: Use -std=gnu11 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu/thread-posix.h')
-rw-r--r--include/qemu/thread-posix.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h
index c903525062..b792e6ef37 100644
--- a/include/qemu/thread-posix.h
+++ b/include/qemu/thread-posix.h
@@ -4,12 +4,6 @@
#include <pthread.h>
#include <semaphore.h>
-typedef QemuMutex QemuRecMutex;
-#define qemu_rec_mutex_destroy qemu_mutex_destroy
-#define qemu_rec_mutex_lock_impl qemu_mutex_lock_impl
-#define qemu_rec_mutex_trylock_impl qemu_mutex_trylock_impl
-#define qemu_rec_mutex_unlock qemu_mutex_unlock
-
struct QemuMutex {
pthread_mutex_t lock;
#ifdef CONFIG_DEBUG_MUTEX
@@ -19,6 +13,14 @@ struct QemuMutex {
bool initialized;
};
+/*
+ * QemuRecMutex cannot be a typedef of QemuMutex lest we have two
+ * compatible cases in _Generic. See qemu/lockable.h.
+ */
+typedef struct QemuRecMutex {
+ QemuMutex m;
+} QemuRecMutex;
+
struct QemuCond {
pthread_cond_t cond;
bool initialized;