Fix a potential deadlock in helper_do_stat()
authorBart Van Assche <bvanassche@acm.org>
Fri, 3 Jan 2020 19:35:22 +0000 (11:35 -0800)
committerBart Van Assche <bvanassche@acm.org>
Sat, 4 Jan 2020 05:46:17 +0000 (21:46 -0800)
commit52a552e21ae25eb175f686935fe85a2956f949ce
tree2fbc01325b34d86cd8a9616246e6c4692f51b8dd
parent998e9ebb1b31371b37c922b37e6db49a84e08201
Fix a potential deadlock in helper_do_stat()

pthread_mutex_lock(), pthread_cond_signal() and pthread_mutex_unlock() are
not async-signal-safe and hence must not be used inside a singal handler
implementation. Rework the code for communication with the helper thread
such that it becomes async-signal-safe.

Compared to commit 31eca641ad91, tests for the pipe() and pipe2() system
calls have been added and a pipe simulation for Windows has been added
(pipe_over_localhost()).

Fixes: a47591e4923f ("Improve logging accuracy")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
configure
helper_thread.c