The
thr_kill()
and
thr_kill2()
system calls allow sending a signal, specified by the
sig
argument, to some threads in a process.
For the
thr_kill()
function, signalled threads are always limited to the current process.
For the
thr_kill2()
function, the
pid
argument specifies the process with threads to be signalled.
The
id
argument specifies which threads get the signal.
If
id
is equal to -1, all threads in the specified process are signalled.
Otherwise, only the thread with the thread identifier equal to the
argument is signalled.
The
sig
argument defines the delivered signal.
It must be a valid signal number or zero.
In the latter case no signal is actually sent, and the call is used to
verify the liveness of the thread.
The signal is delivered with
siginfo
si_code
set to
SI_LWP.