From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: Nicolas Vignal Cc: gdb@sources.redhat.com Subject: Re: thread cannot stop himself Date: Fri, 09 Feb 2001 03:36:00 -0000 Message-id: References: <01020814582000.18700@nicolas> X-SW-Source: 2001-02/msg00101.html Nicolas Vignal writes: > Hello > > I join a sample program with a thread who try to stop himself with a > SIGSTOP. > ( I know that is not the best way to do that ;-) > It works fine in command line but not under gdb. > gdb receive the signal and the flag pass to program is yes. But the thread > never stop. > > Any idea of what happened ? GDB uses SIGSTOP internally (for stopping threads) which interferes horribly with your own use of the signal. I'm loooking into a solution, but things are pretty hairy, and I can't guarantee that I find an acceptable solution to the problem. For now, the only advice I can give you is: don't use SIGSTOP. I'm not sure what you're trying to accomplish by having a thread stop itself, but there should be an alternative to using signals. Try using a mutex, semaphore or perhaps poll/select. Mark