qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex
Date: Tue, 10 Jun 2014 16:24:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

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).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]