errors: Avoid interleaved errors from parallel threads
commitd02d9c9d670f1d7b6888d8ade7ea95e5084ffe2e
authorEric Blake <eblake@redhat.com>
Thu, 16 Nov 2017 19:12:57 +0000 (16 13:12 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 17 Nov 2017 20:15:07 +0000 (17 14:15 -0600)
tree5e19c7f88c994ba1967f992b1941c4aa7a395eb0
parent0e8e8eb11d6b70d262a99b5b630af354768bfc61
errors: Avoid interleaved errors from parallel threads

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>
src/errors.c