NAME
pthread_kill() — send a signal to a thread
SYNOPSIS
#include <signal.h>
int pthread_kill(
pthread_t thread,
int sig
);
PARAMETERS
- thread
Thread to which the signal is to be delivered.
- sig
Signal to be delivered to
thread.
DESCRIPTION
The
pthread_kill()
function is used to request that a signal be delivered to
thread.
The signal is asynchronously directed to
thread
in the calling process. The
signal is handled in the context of the given thread;
if the signal action results in the thread
terminating or stopping, this action is applied to the whole process.
If
sig
is zero, error checking is performed but a signal is not sent.
RETURN VALUE
Upon successful completion,
pthread_kill()
returns zero. Otherwise, an error number is returned to indicate the error
(the
errno
variable is not set).
ERRORS
If any of the following occur, the
pthread_kill()
function returns the corresponding error number:
- [EINVAL]
sig
is an invalid or unsupported signal number.
- [ESRCH]
No thread could be found corresponding to
thread.
AUTHOR
pthread_kill()
was derived from the IEEE POSIX P1003.1c standard.
STANDARDS CONFORMANCE
pthread_kill(): POSIX 1003.1c.