SIGKILL using pthread_kill()

Hi all,

I have a multithreaded application. One of my threads which perform a write() call is in a blocked state and can’t respond to any signals which I send to it.(The underlying resource manager is doing some busy operations and didn’t reply to its client. So my thread is blocked). To terminate that thread, I have called pthread_timedjoin() from its creator thread. When ETIMEDOUT occurs, I tried to call pthread_kill(SIGKILL) to the sub-thread which is already blocked. This solution worked for my scenario.
But what is happening actually? Is the whole process being terminated? Can SIGKILL be used with pthread_kill() to terminate the target thread alone?


SIGKILL is handled entirely in the QNX kernel. It never gets delivered to your process/thread. That’s why it’s an unblockable signal. When the kernel receives this signal it deletes your process immediately without any cleanup being done. It can’t be used to kill a specific thread.