aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--monitor/monitor.c6
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 */