Fix a potential deadlock in helper_do_stat()
authorBart Van Assche <bvanassche@acm.org>
Tue, 31 Dec 2019 17:37:55 +0000 (09:37 -0800)
committerBart Van Assche <bvanassche@acm.org>
Thu, 2 Jan 2020 04:18:40 +0000 (20:18 -0800)
commit31eca641ad91634e5ffcf369cd756b0506a700c1
treee8895743e49b9474964e147479b37f2f25b96c2d
parent6a087e5a0e731a7982980eca6d260cecfaa1742d
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.

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