[PATCH v2 0/2] thread: add lock guard macros

Stefan Hajnoczi posted 2 patches 4 years, 1 month ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200316110957.449700-1-stefanha@redhat.com
include/qemu/lockable.h | 67 +++++++++++++++++++++++++++++++++++++++++
plugins/core.c          |  7 ++---
plugins/loader.c        | 16 +++++-----
util/qemu-timer.c       | 23 +++++++-------
4 files changed, 89 insertions(+), 24 deletions(-)
[PATCH v2 0/2] thread: add lock guard macros
Posted by Stefan Hajnoczi 4 years, 1 month ago
Lock guards automatically call qemu_(rec_)mutex_unlock() when returning from a
function or leaving leaving a lexical scope.  This simplifies code and
eliminates leaks (especially in error code paths).

This series adds lock guards for QemuMutex and QemuRecMutex.  It does not
convert the entire tree but includes example conversions.

Stefan Hajnoczi (2):
  lockable: add lock guards
  lockable: add QemuRecMutex support

 include/qemu/lockable.h | 67 +++++++++++++++++++++++++++++++++++++++++
 plugins/core.c          |  7 ++---
 plugins/loader.c        | 16 +++++-----
 util/qemu-timer.c       | 23 +++++++-------
 4 files changed, 89 insertions(+), 24 deletions(-)

-- 
2.24.1

Re: [PATCH v2 0/2] thread: add lock guard macros
Posted by Paolo Bonzini 4 years, 1 month ago
On 16/03/20 12:09, Stefan Hajnoczi wrote:
> Lock guards automatically call qemu_(rec_)mutex_unlock() when returning from a
> function or leaving leaving a lexical scope.  This simplifies code and
> eliminates leaks (especially in error code paths).
> 
> This series adds lock guards for QemuMutex and QemuRecMutex.  It does not
> convert the entire tree but includes example conversions.
> 
> Stefan Hajnoczi (2):
>   lockable: add lock guards
>   lockable: add QemuRecMutex support
> 
>  include/qemu/lockable.h | 67 +++++++++++++++++++++++++++++++++++++++++
>  plugins/core.c          |  7 ++---
>  plugins/loader.c        | 16 +++++-----
>  util/qemu-timer.c       | 23 +++++++-------
>  4 files changed, 89 insertions(+), 24 deletions(-)
> 

Queued, thanks.

Paolo