Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (n - p) pthread_kill(2)
NAME
pthread_kill - Sends a signal to a thread
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
#include <signal.h>
int pthread_kill(
pthread_t thread,
int sig);
PARAMETERS
thread specifies the thread to receive the signal.
sig specifies the signal to send. The valid values for this parameter are described in
the signal(4) reference page available either online or in the Open System Ser-
vices System Calls Reference Manual.
DESCRIPTION
This function provides a mechanism for asynchronously directing a signal to a thread within the
calling process. Per-thread signals have the following characteristics:
• Each signal is handled in the context of the specified thread. However, the signal action
(terminating or stopping) affects the entire process.
• Signal action should be manipulated using the sigaction() function instead of the sig-
nal() function.
• Job control signals are not supported. The stop/continue-a-process actions implied by
these signals is not supported.
• Signals send using pthread_kill() are queued in first-in/first-out (FIFO) order for the tar-
get thread; more than one instance of the same signal can be pending for a thread. How-
ever, applications should not rely on this ordering.
• The realtime signals extension option is not supported.
• Whether a signal generates a saveabend file can be controled using a compiler or linker
option.
• If a signal is delivered to a thread that is waiting on a condition variable, upon return
from the signal handler the thread resumes waiting for the condition variable as if it had
not been interrupted. The thread is not unblocked with a 0 (zero) return code.
Specifying a sig value of 0 (zero) causes this function to validate the thread parameter but not to
send any signal.
If this function does not execute successfully, no signal is sent.
NOTES
The name of this function is misleading, because many signals do not terminate a thread.
527186-003 Hewlett-Packard Company 5−73