int pthread_kill(pthread_t tid, int sig);
#include <pthread.h> #include <signal.h> int sig; pthread_t tid; int ret; ret = pthread_kill(tid, sig);
pthread_kill() sends the signal sig to the thread specified by tid. tid must be a thread within the same process as the calling thread. Thesig argument must be from the list that is given in signal.h(3HEAD).
When sig is zero, error checking is performed but no signal is actually sent. This error checking can be used to check the validity of tid.