Sends a signal to the specified thread.
Threads Library (libpthreads.a)
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.
Item | Description |
---|---|
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:
Item | Description |
---|---|
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.