Reputation: 374
I want to send a signal from a process to a thread that is created from another process (that have not created the thread.
What I know about this that:
raise: sends signal to same process
pthread_kill can send singal to a thread from same prcess, i.e that created that thread. you cannot use pthread_kill to send a signal to thread from another process.
kill sends signal to a process
Is there any way to send signal to a thread from another process?
Hope I am clear!!! NOTE: I am new to unix and threading
Upvotes: 0
Views: 1767
Reputation: 182609
There is an appropriately named tkill(2)
:
tkill, tgkill - send a signal to a thread tgkill() sends the signal sig to the thread with the thread ID tid
You can get a tid using gettid(2)
.
Beware: the concept of a TID and therefore everything having to do with one is Linux-specific.
Upvotes: 1
Reputation: 672
You Should Read About
pthread_signal()
Should set you in the right direction
Upvotes: 0