Multithreaded Programming Guide

Send a Signal to a Thread

thr_kill(3C) sends a signal to a thread. For POSIX threads, see pthread_kill Syntax.

thr_kill Syntax

#include <thread.h>
#include <signal.h>
int thr_kill(thread_t target_thread, int sig);

thr_kill Return Values

Upon successful completion, thr_kill() returns 0. When any of the following conditions is detected, thr_kill() fails and returns the corresponding value. When a failure occurs, no signal is sent.



No thread was found associated with the thread designated by thread ID.



The sig argument value is not zero. sig is an invalid or unsupported signal number.