This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] suspend all thread on SIGSTOP
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-patches at cygwin dot com
- Date: Fri, 31 Oct 2003 16:26:56 -0500
- Subject: Re: [PATCH] suspend all thread on SIGSTOP
- References: <3FA2D171.6080806@gmx.net>
- Reply-to: cygwin-patches at cygwin dot com
On Fri, Oct 31, 2003 at 10:17:37PM +0100, Thomas Pfaff wrote:
>This time with attachment.
>
>This patch suspends all threads on SIGSTOP and resumes them on SIGCONT.
>The corresponding functions in the pthread class are already committed.
>
>Thomas
>
>2003-10-31 Thomas Pfaff <tpfaff@gmx.net>
>
> * exceptions.cc (sig_handle_tty_stop): Suspend all
> threads on SIGSTOP, resume them on SIGCONT.
You can't suspend threads like this because SuspendThread can
hang in some situations, like when a thread is doing I/O. That's why
there is a WaitForSingleObject here rather than just suspending the
thread.
It is not a perfect solution, obviously but this will just cause people
to complain about multi-threaded processes hanging after they hit CTRL-Z.
cgf