[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/5] thread-pool: convert to use lock guards
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 5/5] thread-pool: convert to use lock guards |
Date: |
Mon, 11 Dec 2017 23:03:02 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
On 11/12/2017 11:23, Stefan Hajnoczi wrote:
>>
>> In other words, I don't see what 'QEMU_WITH_LOCK_GUARD() {}' buys us
>> over '{ QEMU_LOCK_GUARD() }'.
> The QEMU_WITH_LOCK_GUARD() {} syntax is nice because it's similar to
> if/while/for statements.
>
> However, { QEMU_LOCK_GUARD() } doesn't hide a for statement in a macro
> so the break statement works inside the scope. Less chance of bugs.
The same is true of a "switch" statement. Being able to break out of
QEMU_WITH_LOCK_GUARD could also be a feature...
Paolo
> I'd be okay without QEMU_WITH_LOCK_GUARD().
signature.asc
Description: OpenPGP digital signature
Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup)), Eric Blake, 2017/12/08
Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup)), no-reply, 2017/12/11
Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup)), no-reply, 2017/12/11