[Qemu-devel] [PATCH 1/4] lockable: add QemuLockable

2018-01-16 Thread Paolo Bonzini
QemuLockable is a polymorphic lock type that takes an object and knows which function to use for locking and unlocking. The implementation could use C11 _Generic, but since the support is not very widespread I am instead using __builtin_choose_expr and __builtin_types_compatible_p, which are alrea

Re: [Qemu-devel] [PATCH 1/4] lockable: add QemuLockable

2018-01-16 Thread Fam Zheng
On 01/16/2018 06:08 AM, Paolo Bonzini wrote: QemuLockable is a polymorphic lock type that takes an object and knows which function to use for locking and unlocking. The implementation could use C11 _Generic, but since the support is not very widespread I am instead using __builtin_choose_expr

[Qemu-devel] [PATCH 1/4] lockable: add QemuLockable

2018-01-15 Thread Paolo Bonzini
QemuLockable is a polymorphic lock type that takes an object and knows which function to use for locking and unlocking. The implementation could use C11 _Generic, but since the support is not very widespread I am instead using __builtin_choose_expr and __builtin_types_compatible_p, which are alrea