|
From: | Paolo Bonzini |
Subject: | Re: [PATCH 6/8] include/qemu/lockable: Use _Generic instead of QEMU_GENERIC |
Date: | Mon, 14 Jun 2021 13:14:17 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 12/06/21 01:33, Richard Henderson wrote:
- unknown_lock_type)) +/* Auxiliary macros to simplify QEMU_MAKE_LOCABLE. */ +#define QEMU_LOCK_FUNC(x) ((QemuLockUnlockFunc *) \ + _Generic((x), QemuMutex *: qemu_mutex_lock, \ + QemuRecMutex *: qemu_rec_mutex_lock, \ + CoMutex *: qemu_co_mutex_lock, \ + QemuSpin *: qemu_spin_lock)) + +#define QEMU_UNLOCK_FUNC(x) ((QemuLockUnlockFunc *) \ + _Generic((x), QemuMutex *: qemu_mutex_unlock, \ + QemuRecMutex *: qemu_rec_mutex_unlock, \ + CoMutex *: qemu_co_mutex_unlock, \ + QemuSpin *: qemu_spin_unlock))
These are not needed anymore, are they?Otherwise I agree that it's both more and less complicated. The duplication between QEMU_MAKE_LOCKABLE_NONNULL and QEMU_MAKE_LOCKABLE is tolerable.
Thanks, Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |