Sends a signal to the specified thread.
Threads Library (libpthreads.a)
#include <signal.h> int pthread_kill (thread, signal) pthread_t thread; int signal;
The pthread_kill subroutine sends the signal signal to the thread thread. It acts with threads like the kill subroutine with single-threaded processes.
If the receiving thread has blocked delivery of the signal, the signal remains pending on the thread until the thread unblocks delivery of the signal or the action associated with the signal is set to ignore the signal.
thread | Specifies the target thread for the signal. |
signal | Specifies the signal to be delivered. If the signal value is 0, error checking is performed, but no signal is delivered. |
Upon successful completion, the function returns a value of zero. Otherwise the function returns an error number. If the pthread_kill function fails, no signal is sent.
The pthread_kill function will fail if:
ESRCH | No thread could be found corresponding to that specified by the given thread ID. |
EINVAL | The value of the signal parameter is an invalid or unsupported signal number. |
The pthread_kill function will not return an error code of EINTR.
The kill (kill or killpg Subroutine) subroutine, pthread_cancel (pthread_cancel Subroutine) subroutine, pthread_create (pthread_create Subroutine) subroutine, sigaction subroutine, pthread_self (pthread_self Subroutine) subroutine, raise subroutine, pthread.h file.
Signal Management in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
Threads Library Quick Reference in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.