1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
|
<HTML
><HEAD
><TITLE
>pthread_kill</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
"></HEAD
><BODY
CLASS="REFENTRY"
><H1
><A
NAME="AEN1"
>pthread_kill</A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN5"
></A
><H2
>Name</H2
>pthread_kill -- send a signal to a thread</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8"
></A
><H2
>Synopsis</H2
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SYNOPSIS"
> #include <rtl_signal.h>
#include <rtl_sched.h>
int <TT
CLASS="FUNCTION"
>pthread_kill</TT
>(pthread_t <TT
CLASS="PARAMETER"
><I
>thread</I
></TT
>,<TT
CLASS="PARAMETER"
><I
>signo</I
></TT
>);</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN13"
></A
><H2
>DESCRIPTION</H2
><P
>This function is a standard POSIX threads function. <TT
CLASS="FUNCTION"
>pthread_kill</TT
> sends signal <TT
CLASS="PARAMETER"
><I
>signo</I
></TT
> to the realtime thread <TT
CLASS="PARAMETER"
><I
>thread</I
></TT
> previously created by a call to <TT
CLASS="FUNCTION"
>pthread_create</TT
>. <TT
CLASS="FUNCTION"
>pthread_kill</TT
> is a fast and deterministic function if called on threads running on the same processor as the calling thread or interrupt handler. <TT
CLASS="FUNCTION"
>pthread_kill</TT
> can be used to send signals
to threads running on other than current CPU, but this is a more expensive
operation and there may be delays before the signal will be detected by
the target thread.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN22"
></A
><H2
>RETURN VALUE</H2
><P
><TT
CLASS="FUNCTION"
>pthread_kill</TT
> returns 0 on success and a non-zero error code on error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN26"
></A
><H2
>ERRORS</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>ESRCH</DT
><DD
><P
>No thread could be found corresponding to that specified by the given thread ID.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN33"
></A
><H2
>AUTHOR</H2
><P
>Victor Yodaiken (<A
HREF="mailto:support@fsmlabs.com"
TARGET="_top"
>support@fsmlabs.com</A
>)</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN37"
></A
><H2
>NOTES</H2
><P
><TT
CLASS="FUNCTION"
>pthread_kill</TT
> is safe to call from a signal handler, a
thread and from Linux kernel code.
<TT
CLASS="FUNCTION"
>pthread_kill</TT
> is one of the primary means of sending
signals to the general purpose operating system (Linux). A call
<TT
CLASS="FUNCTION"
>pthread_kill(<TT
CLASS="PARAMETER"
><I
>pthread_linux()</I
></TT
>,<TT
CLASS="PARAMETER"
><I
>RTL_LINUX_MIN_SIGNA+n</I
></TT
>)</TT
> for an integer value <TT
CLASS="PARAMETER"
><I
>n</I
></TT
>
will generate irq <TT
CLASS="PARAMETER"
><I
>n</I
></TT
> in the Linux thread.</P
><P
><TT
CLASS="FUNCTION"
>pthread_kill(<TT
CLASS="PARAMETER"
><I
>pthread_linux()</I
></TT
>,<TT
CLASS="PARAMETER"
><I
>RTL_SIG_SUSPEND_LINUX</I
></TT
>)</TT
> sends the Linux thread on the
highest numbered processor an interrupt that will force Linux to suspend itself and
to tell the hardware to ignore all non-RTLinux interrupts (if possible). This
allows a processor on an SMP system to be dedicated to RTLinux. To restore
suspended Linux threads, in order, use RTL_SIG_RESTART_LINUX. The RESERVE_PROCESSOR config option must be selected when building RTLinux to enable this
feature.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN51"
></A
><H2
>SEE ALSO</H2
><A
HREF="pthread_create.3.html"
TARGET="_top"
>pthread_create(3)</A
>, <A
HREF="pthread_linux.3.html"
TARGET="_top"
>pthread_linux(3)</A
><P
>2001 FSMLabs Inc.</P
><P
>All rights reserved.</P
></DIV
></BODY
></HTML
>
|