Subject: bug#28630: 27.0.50;C-g while a non-main thread is sitting crashes Emacs

From: Eli Zaretskii <[email-masked]>
Date: Mon, 09 Oct 2017 14:01:05 +0300

> Date: Mon, 9 Oct 2017 19:34:28 +0900
> From: [email-masked]
> Cc: [email-masked],
>  [email-masked],
>  [email-masked]
> 
> In both Examples, the main thread is not blocking at pselect, but
> thread-join (sys_cond_wait internally), i.e., without monitoring
> the keyboard descriptor. The secondary one is blocking at pselect
> in sit-for (Example 1) or sleep-for (Example 2).  So "none of
> other threads is monitoring the keyboard input channel" part
> becomes true for the secondary thread after returning from
> pselect.

OK, with thread-join this is so.  Sorry for missing that part.

In any case, on TTY frames C-g triggers SIGINT, and we always deliver
signals to the main thread.  If we want to be able to handle keyboard
input in non-main threads, we should change how signals are handled in
Emacs.