[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup)) |
Date: |
Mon, 11 Dec 2017 09:38:03 +0000 |
On 8 December 2017 at 19:40, Eric Blake <address@hidden> wrote:
> On 12/08/2017 04:55 AM, Paolo Bonzini wrote:
>> Likewise,
>>
>> QEMU_WITH_LOCK(QemuMutex, guard_name, &some_mutex) {
>> ...
>> }
>>
>> is the same as
>>
>> qemu_mutex_lock(&some_mutex);
>> ...
>> qemu_mutex_unlock(&some_mutex);
>>
>> except that any returns within the region will unlock the mutex.
>
> Not just returns, but ANY manner that you leave the scope, including a
> goto or just falling out of the end of the scope.
How about longjmp()ing out of it?
thanks
-- PMM
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)),
Peter Maydell <=
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
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)), Emilio G. Cota, 2017/12/11