Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
monitor: use QEMU_LOCK_GUARD a bit more
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed May 25, 2023
1 parent 690705c commit e37548e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions monitor/monitor.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit e37548e

Please sign in to comment.