diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-06-14 16:31:40 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2021-06-15 18:31:00 -0700 |
commit | 6c98635ed7772e63b98944ab972c1eef8e498da3 (patch) | |
tree | 9ac8d75f0f828b0562423c6e25f4513f95af9375 /include | |
parent | 9c75bae717eae4c139cbd8b6a713cff01fe718f0 (diff) |
util: Use unique type for QemuRecMutex in thread-posix.h
We will shortly convert lockable.h to _Generic, and we cannot
have two compatible types in the same expansion. Wrap QemuMutex
in a struct, and unwrap in qemu-thread-posix.c.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210614233143.1221879-6-richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/thread-posix.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h index cf8bc90468..b792e6ef37 100644 --- a/include/qemu/thread-posix.h +++ b/include/qemu/thread-posix.h @@ -4,8 +4,6 @@ #include <pthread.h> #include <semaphore.h> -typedef QemuMutex QemuRecMutex; - struct QemuMutex { pthread_mutex_t lock; #ifdef CONFIG_DEBUG_MUTEX @@ -15,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; |