[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex |
Date: |
Tue, 10 Jun 2014 10:28:12 -0400 |
On Tue, 10 Jun 2014 16:24:29 +0200
Paolo Bonzini <address@hidden> wrote:
> Il 10/06/2014 16:10, Luiz Capitulino ha scritto:
> >> > + qemu_mutex_lock(&hmp.out_lock);
> >> > if (qstring_get_length(hmp.outbuf) > 0) {
> >> > output = g_strdup(qstring_get_str(hmp.outbuf));
> >> > } else {
> >> > output = g_strdup("");
> >> > }
> >> > + qemu_mutex_unlock(&hmp.out_lock);
> > Are you sure we need to lock/unlock in this function? hmp is allocated
> > in the stack.
> >
>
> No, we don't but it was more obvious to me this way (and looking at it
> again, I'm pretty sure that some static analyzer would complain without
> these).
Fine, I'm OK with that.