pthread_kill(3T)
NAME
pthread_kill, thr_kill − send a signal to a thread
SYNOPSIS
POSIX
cc [ flag ... ] file ... −lpthread [ library ... ]
#include <signal.h>
#include <pthread.h>
int pthread_kill(pthread_t thread, int sig);
Solaris
cc [ flag ... ] file ... −lthread [ library ... ]
#include <signal.h>
#include <thread.h>
int thr_kill(thread_t thread, int sig);
MT-LEVEL
MT-Safe
Async-Signal-Safe
DESCRIPTION
pthread_kill() sends the sig signal to the thread designated by thread. thread must be a member of the same process as the calling thread. sig must be one of the signals listed in signal(5); with the exception of SIGLWP, SIGCANCEL, and SIGWAITING being reserved and off limits to thr_kill() or pthread_kill(). If sig is 0, a validity check is done for the existence of the target thread; no signal is sent.
thr_kill() performs the same function as pthread_kill().
RETURN VALUES
Upon successful completion, pthread_kill() and thr_kill() return 0; otherwise, they return an error number. In the event of failure, no signal is sent.
ERRORS
ESRCH No thread was found that corresponded to the thread designated by thread ID.
EINVAL The sig argument value is not zero and is an invalid or an unsupported signal number.
SEE ALSO
kill(2), sigaction(2), pthread_self(3T), pthread_sigmask(3T), raise(3C), signal(5)
NOTES
Although pthread_kill() is Async-Signal-Safe with respect to the Solaris environment, this safeness is not guaranteed to be portable to other POSIX domains.
SunOS 5.5.1 — Last change: 30 Jun 1995