Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.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
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
H-series and J-series OSS processes that use the Standard POSIX Threads library:
/G/system/zdllnnn/zsptdll
SYNOPSIS
#include <pthread.h> | #include <spthread.h>
/* pthread.h is required to use POSIX User Thread Model library */
/* spthread.h is required to use Standard POSIX Threads library */
#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.
527186-023 Hewlett-Packard Company 5133