Cygwin: exceptions.cc: Suspend all threads in sig_handle_tty_stop().

- Currently, thread created by pthread_create() is not suspended by
  the signal SIGTSTP. For example, even if a process with a thread
  is suspended by Ctrl-Z, the thread continues running. This patch
  fixes the issue.
This commit is contained in:
Takashi Yano via Cygwin-patches 2021-01-29 12:46:26 +09:00 committed by Corinna Vinschen
parent 6ab2d284e5
commit 6c1552b0da
1 changed files with 2 additions and 0 deletions

View File

@ -902,7 +902,9 @@ sig_handle_tty_stop (int sig, siginfo_t *, void *)
thread. */
/* Use special cygwait parameter to handle SIGCONT. _main_tls.sig will
be cleared under lock when SIGCONT is detected. */
pthread::suspend_all_except_self ();
DWORD res = cygwait (NULL, cw_infinite, cw_sig_cont);
pthread::resume_all ();
switch (res)
{
case WAIT_SIGNALED: