Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-15 Thread Richard Henderson
On 12/12/2017 02:41 PM, Eric Blake wrote: > On 12/11/2017 03:32 PM, Paolo Bonzini wrote: >> On 11/12/2017 15:11, Eric Blake wrote: >>> I don't know if there is a way to make gcc insert stack-unwind >>> directives that are honored across longjmp (I know C++ does it for >>> exceptions; so there may

Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-12 Thread Eric Blake
On 12/11/2017 03:32 PM, Paolo Bonzini wrote: > On 11/12/2017 15:11, Eric Blake wrote: >> I don't know if there is a way to make gcc insert stack-unwind >> directives that are honored across longjmp (I know C++ does it for >> exceptions; so there may be a way, and I just don't know it). > >

Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-11 Thread Emilio G. Cota
On Fri, Dec 08, 2017 at 11:55:48 +0100, Paolo Bonzini wrote: > So I'm a bit underwhelmed by this experiment. Other opinions? I am on the same boat. Most use cases in this patchset are arguably adding more complexity because they substitute already very simple code (e.g. "lock; do_something;

Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-11 Thread Paolo Bonzini
On 11/12/2017 15:11, Eric Blake wrote: > I don't know if there is a way to make gcc insert stack-unwind > directives that are honored across longjmp (I know C++ does it for > exceptions; so there may be a way, and I just don't know it). Probably -fexceptions. Paolo > Conversely, I do know that

Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-11 Thread Eric Blake
On 12/11/2017 03:38 AM, Peter Maydell wrote: > On 8 December 2017 at 19:40, Eric Blake wrote: >> On 12/08/2017 04:55 AM, Paolo Bonzini wrote: >>> Likewise, >>> >>> QEMU_WITH_LOCK(QemuMutex, guard_name, _mutex) { >>> ... >>> } >>> >>> is the same as >>> >>>

Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-11 Thread Peter Maydell
On 8 December 2017 at 19:40, Eric Blake wrote: > On 12/08/2017 04:55 AM, Paolo Bonzini wrote: >> Likewise, >> >> QEMU_WITH_LOCK(QemuMutex, guard_name, _mutex) { >> ... >> } >> >> is the same as >> >> qemu_mutex_lock(_mutex); >> ... >>

Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-10 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20171208105553.12249-1-pbonz...@redhat.com Subject: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup)) Type: series === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1

Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-10 Thread no-reply
Hi, This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Message-id: 20171208105553.12249-1-pbonz...@redhat.com Subject: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute

Re: [Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-08 Thread Eric Blake
On 12/08/2017 04:55 AM, Paolo Bonzini wrote: > This is an attempt to make a C API that resembles the C++ > std::unique_lock (mostly untested). The idea is that you can write > > QEMU_LOCK_GUARD(QemuMutex, guard_name, _mutex); > > instead of > > qemu_mutex_lock(_mutex); > ... > out:

[Qemu-devel] [RFC PATCH 0/5] Scoped locks using attribute((cleanup))

2017-12-08 Thread Paolo Bonzini
This is an attempt to make a C API that resembles the C++ std::unique_lock (mostly untested). The idea is that you can write QEMU_LOCK_GUARD(QemuMutex, guard_name, _mutex); instead of qemu_mutex_lock(_mutex); ... out: qemu_mutex_unlock(_mutex); and the mutex will be unlocked