b*s 发帖数: 1 | 1 In a multithread task, sigset(SIGINT, SIG_DFL) is called. then one thread
sends SIGINT through pthread_kill() to the other thread.
Why the receiving thread is not terminated? Thanks a lot,
The receiving thread got EINTR if it is in read() system call since read()
returns -1.
What if recieving thread in an empty while loop. | y*****p 发帖数: 733 | 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I experienced the same problem!! And the pthread_kill just terminated
the program when I send SIGTERM. if I use SIGKILL, pthread_kill kill.
The other thing I hate is that it doesn't give you any error!
I switch to pthread_cancel. It's said it's not a good way to use.
But at lease it seems to work for my hw.
【在 b*s 的大作中提到】 : In a multithread task, sigset(SIGINT, SIG_DFL) is called. then one thread : sends SIGINT through pthread_kill() to the other thread. : Why the receiving thread is not terminated? Thanks a lot, : The receiving thread got EINTR if it is in read() system call since read() : returns -1. : What if recieving thread in an empty while loop.
| y*****p 发帖数: 733 | 3
I mean POSIX thread. pthread_kill seems to work for Solaris thread.
【在 y*****p 的大作中提到】 : : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : I experienced the same problem!! And the pthread_kill just terminated : the program when I send SIGTERM. if I use SIGKILL, pthread_kill kill. : The other thing I hate is that it doesn't give you any error! : I switch to pthread_cancel. It's said it's not a good way to use. : But at lease it seems to work for my hw.
|
|