monitor: use QEMU_LOCK_GUARD a bit more
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
690705ca0b
commit
e37548ef13
@ -161,10 +161,9 @@ static gboolean monitor_unblocked(void *do_not_use, GIOCondition cond,
|
|||||||
{
|
{
|
||||||
Monitor *mon = opaque;
|
Monitor *mon = opaque;
|
||||||
|
|
||||||
qemu_mutex_lock(&mon->mon_lock);
|
QEMU_LOCK_GUARD(&mon->mon_lock);
|
||||||
mon->out_watch = 0;
|
mon->out_watch = 0;
|
||||||
monitor_flush_locked(mon);
|
monitor_flush_locked(mon);
|
||||||
qemu_mutex_unlock(&mon->mon_lock);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,9 +202,8 @@ static void monitor_flush_locked(Monitor *mon)
|
|||||||
|
|
||||||
void monitor_flush(Monitor *mon)
|
void monitor_flush(Monitor *mon)
|
||||||
{
|
{
|
||||||
qemu_mutex_lock(&mon->mon_lock);
|
QEMU_LOCK_GUARD(&mon->mon_lock);
|
||||||
monitor_flush_locked(mon);
|
monitor_flush_locked(mon);
|
||||||
qemu_mutex_unlock(&mon->mon_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* flush at every end of line */
|
/* flush at every end of line */
|
||||||
|
Loading…
Reference in New Issue
Block a user