diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2023-05-17 14:47:55 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-05-25 10:18:33 +0200 |
commit | e37548ef13dcbe158662c8dc9797c15c052c3a81 (patch) | |
tree | ca9c2a74b1d10547ca41ceb62fa20ccc7c28353a /monitor | |
parent | 690705ca0b0f1ed24a34ccd14c9866fbe47c69a6 (diff) |
monitor: use QEMU_LOCK_GUARD a bit more
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/monitor.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/monitor/monitor.c b/monitor/monitor.c index 602535696c..4b11bca2a2 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -161,10 +161,9 @@ static gboolean monitor_unblocked(void *do_not_use, GIOCondition cond, { Monitor *mon = opaque; - qemu_mutex_lock(&mon->mon_lock); + QEMU_LOCK_GUARD(&mon->mon_lock); mon->out_watch = 0; monitor_flush_locked(mon); - qemu_mutex_unlock(&mon->mon_lock); return FALSE; } @@ -203,9 +202,8 @@ static void monitor_flush_locked(Monitor *mon) void monitor_flush(Monitor *mon) { - qemu_mutex_lock(&mon->mon_lock); + QEMU_LOCK_GUARD(&mon->mon_lock); monitor_flush_locked(mon); - qemu_mutex_unlock(&mon->mon_lock); } /* flush at every end of line */ |