This is the mail archive of the
mailing list for the GDB project.
thread cannot stop himself
- To: gdb at sources dot redhat dot com
- Subject: thread cannot stop himself
- From: Nicolas Vignal <nicolas dot vignal at netline dot fr>
- Date: Thu, 8 Feb 2001 14:58:20 +0100
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
Any idea of what happened ?
I'am using a Linux RedHat 6.2 with insight 20010202
printf("I want to stop this thread\n");
printf("Why it's not working ?\n");
int main(int argc, char *argv)
pthread_create(&threadID, NULL, function, NULL);
Starting program: /home/tsc/essai/stopthread
[New Thread 1024 (runnable)]
[New Thread 2049 (runnable)]
[New Thread 1026 (runnable)]
Program received signal SIGSTOP, Stopped (signal).
[Switching to Thread 1026 (runnable)]
0x4004dd41 in __kill () from /lib/libc.so.6
(gdb) handle SIGSTOP
Signal Stop Print Pass to program Description
SIGSTOP Yes Yes Yes Stopped (signal)
After I can see "Why it's not working ?" in loop