* Re: [PATCH RFA] Linux threads, SIGINT handling [not found] <3B0EB00D.6F856A32@cygnus.com> @ 2001-05-26 1:07 ` Mark Kettenis 2001-05-30 11:10 ` Michael Snyder 0 siblings, 1 reply; 2+ messages in thread From: Mark Kettenis @ 2001-05-26 1:07 UTC (permalink / raw) To: msnyder; +Cc: gdb-patches Date: Fri, 25 May 2001 12:18:37 -0700 From: Michael Snyder <msnyder@cygnus.com> Mark, When a user types ^C(break) at a tty on Linux, SIGINT is sent to every thread in the process group (whether by the kernel or by the manager thread, I do not know). The effect is that, if you type ^C once, you have to say "continue" N times (once for every user thread). It's the kernel that sends all those SIGINTs, since to the kernel our program is just a bunch of processes sharing their VM. And indeed, the effect is rather annoying. This patch handles that problem by discarding the redundant SIGINT events (ie. all of them except the one that was actually detected in lin_lwp_wait). I don't think it's OK to unconditionally discard the SIGINT events. The process might want to do something special with those, and may depend on getting them in every thread. How about changing the else if (WSTOPSIG (status) == SIGINT) into else if (WSTOPSIG (status) == SIGINT && signal_pass_state (SIGINT) == 0) ? Not passing SIGINT to the inferior is GDB's default, so this will work fine for most people. And this way people can say "handle SIGINT pass" ignore the warning, and have SIGINT delivered to all threads. If you agree, it's OK to check this in with that change. Mark ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH RFA] Linux threads, SIGINT handling 2001-05-26 1:07 ` [PATCH RFA] Linux threads, SIGINT handling Mark Kettenis @ 2001-05-30 11:10 ` Michael Snyder 0 siblings, 0 replies; 2+ messages in thread From: Michael Snyder @ 2001-05-30 11:10 UTC (permalink / raw) To: Mark Kettenis; +Cc: gdb-patches Mark Kettenis wrote: > > Date: Fri, 25 May 2001 12:18:37 -0700 > From: Michael Snyder <msnyder@cygnus.com> > > Mark, > > When a user types ^C(break) at a tty on Linux, SIGINT is sent to every > thread in the process group (whether by the kernel or by the manager > thread, I do not know). The effect is that, if you type ^C once, you > have to say "continue" N times (once for every user thread). > > It's the kernel that sends all those SIGINTs, since to the kernel our > program is just a bunch of processes sharing their VM. And indeed, > the effect is rather annoying. > > This patch handles that problem by discarding the redundant SIGINT > events (ie. all of them except the one that was actually detected in > lin_lwp_wait). > > I don't think it's OK to unconditionally discard the SIGINT events. > The process might want to do something special with those, and may > depend on getting them in every thread. How about changing the > > else if (WSTOPSIG (status) == SIGINT) > > into > > else if (WSTOPSIG (status) == SIGINT > && signal_pass_state (SIGINT) == 0) > > ? Not passing SIGINT to the inferior is GDB's default, so this will > work fine for most people. And this way people can say > > "handle SIGINT pass" > > ignore the warning, and have SIGINT delivered to all threads. > > If you agree, it's OK to check this in with that change. Agreed and committed. Michael ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-05-30 11:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <3B0EB00D.6F856A32@cygnus.com>
2001-05-26 1:07 ` [PATCH RFA] Linux threads, SIGINT handling Mark Kettenis
2001-05-30 11:10 ` Michael Snyder
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox