Index of Section 2 Manual Pages
| Interix / SUA | pthread_kill.2 | Interix / SUA |
pthread_kill(2) pthread_kill(2)
pthread_kill()
NAME
pthread_kill() - send a signal to a thread
SYNOPSIS
#include
int pthread_kill(pthread_t thread, int sig);
DESCRIPTION
The pthread_kill(2) function requests that the signal specified by the sig
argument be sent to the thread specified by the thread argument. As with
the kill(2) function, if 0 is specified as the signal, error checking is
performed but no signal is sent.
The pthread_kill() function gives an application the ability to send a
signal to a thread in the calling process. One thread can use this, for
example, to affect broadcast delivery of a signal to a set of threads.
Note that pthread_kill() only causes the signal to be handled in the
context of the given thread, but the action signalled, such as termination
or stopping, affects the process as a whole.
RETURN VALUES
On success, the function returns 0; otherwise, an error code is returned.
ERRORS
The pthread_kill() function can fail for the following reasons:
[ESRCH]
The thread argument does not identify an existing thread.
[EINVAL]
The value of sig is an invalid or unsupported signal number.
This function does not return [EINTR].
SEE ALSO
kill(2)
pthread_self(2)
raise(3)
USAGE NOTES
The pthread_kill function is thread safe.
The pthread_kill function is not async-signal safe.