From: Paul Eggert Date: Fri, 30 Dec 2016 17:45:46 +0000 (-0800) Subject: * src/sysdep.c (deliver_process_signal): Improve comment. X-Git-Tag: emacs-26.0.90~990 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=83cc8a19b45cb2279c128b781e79d81bb91aac58;p=emacs.git * src/sysdep.c (deliver_process_signal): Improve comment. --- diff --git a/src/sysdep.c b/src/sysdep.c index 86d420f66c4..1ba336e387a 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) {