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

Re: [Libguestfs] [nbdkit PATCH 1/4] errors: Avoid interleaved errors from parallel threads

On 11/17/2017 02:50 AM, Richard W.M. Jones wrote:
> On Thu, Nov 16, 2017 at 09:13:55PM -0600, Eric Blake wrote:
>> Since we construct our error/debug messages via multiple calls
>> to stdio primitives, we are at risk of multiple threads interleaving
>> their output if they try to output at once.  Add a mutex to group
>> related outputs into an atomic chunk.
>> Signed-off-by: Eric Blake <eblake redhat com>
>> ---

>> +static void
>> +unlock (void)
>> +{
>> +  int r = pthread_mutex_unlock(&errors_lock);
>> +  assert(!r);
> Spaces between assert (in 2 cases above) and parens.
> The rest of this patch is fine, so ACK.

Yep, I have to remind myself which coding style I'm under, especially as
I've posted patches to three projects with three different styles this
week (all in the name of getting nbd-server, qemu-nbd, and nbdkit to
better integrate with one another).

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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