qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] thread: add lock guard macros
@ 2020-03-16 11:09 Stefan Hajnoczi
  2020-03-16 11:09 ` [PATCH v2 1/2] lockable: add lock guards Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2020-03-16 11:09 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Alex Bennée, Markus Armbruster,
	Stefan Hajnoczi, Dr. David Alan Gilbert

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-16 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-16 11:09 [PATCH v2 0/2] thread: add lock guard macros Stefan Hajnoczi
2020-03-16 11:09 ` [PATCH v2 1/2] lockable: add lock guards Stefan Hajnoczi
2020-03-16 11:09 ` [PATCH v2 2/2] lockable: add QemuRecMutex support Stefan Hajnoczi
2020-03-16 11:29 ` [PATCH v2 0/2] thread: add lock guard macros Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).