This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: thread cannot stop himself
- To: Mark Kettenis <kettenis at wins dot uva dot nl>, gdb at sources dot redhat dot com
- Subject: Re: thread cannot stop himself
- From: Nicolas Vignal <nicolas dot vignal at fnac dot net>
- Date: Mon, 12 Feb 2001 16:11:09 +0100
- Cc: gdb at sources dot redhat dot com
- References: <01020814582000.18700@nicolas> <s3i3ddom6l4.fsf@debye.wins.uva.nl>
Thanks for your answer, I found this messages in the mailing list
http://sources.redhat.com/ml/gdb/2000-10/msg00001.html
still you ;-)
I will try to use less SIGSTOP but I need a way to stop threads.
Regards
Nicolas
On Friday 09 February 2001 12:36, Mark Kettenis wrote:
> Nicolas Vignal <nicolas.vignal@netline.fr> 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