NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO
#include <pthread.h> #include <signal.h>int pthread_kill(pthread_t thread, int sig);
The pthread_kill function sends an asynchronous signal to the thread specified.
The signal type sig must be equal to SIGTHREADKILL, or zero. The SIGTHREADKILL signal unconditionally deletes the target thread. It may not be caught, ignored, or blocked. No other signal types are supported. General POSIX signal features are not supported by the CHORUS/POSIX Micro Realtime Profile.
If the target thread was created with PTHREAD_CREATE_JOINABLE, it is suspended at its current point of execution. A pending or subsequent pthread_join for this thread will return the exit status value PTHREAD_KILLED. If the target thread is in the PTHREAD_CREATE_DETACHED state, it is deleted immediately by the pthread_kill call.
The sig parameter may be zero, in which case error checking is performed but no signal is actually sent.
Upon successful completion, pthread_kill returns a value of zero. Otherwise, no signal is sent, and an error code is returned. (NOTE: errno is not set.)
The thread argument is not a valid thread identifier. The sig argument is neither zero nor SIGTHREADKILL.
No thread corresponding to the identifier thread was found.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO