From c971e9141d401a5cf4aae96d981d8eb8a9300ec2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 30 Dec 2016 09:45:46 -0800 Subject: [PATCH] * src/sysdep.c (deliver_process_signal): Improve comment. --- src/sysdep.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sysdep.c b/src/sysdep.c index 86d420f..1ba336e 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1616,14 +1616,17 @@ static pthread_t main_thread; #endif /* SIG has arrived at the current process. Deliver it to the main - thread, which should handle it with HANDLER. + thread, which should handle it with HANDLER. (Delivering the + signal to some other thread might not work if the other thread is + about to exit.) If we are on the main thread, handle the signal SIG with HANDLER. Otherwise, redirect the signal to the main thread, blocking it from this thread. POSIX says any thread can receive a signal that is associated with a process, process group, or asynchronous event. - On GNU/Linux that is not true, but for other systems (FreeBSD at - least) it is. */ + On GNU/Linux the main thread typically gets a process signal unless + it's blocked, but other systems (FreeBSD at least) can deliver the + signal to other threads. */ void deliver_process_signal (int sig, signal_handler_t handler) { -- 2.7.4