pthread_kill.html

来自「IEEE 1003.1-2003, Single Unix Specificat」· HTML 代码 · 共 142 行

HTML
142
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>pthread_kill</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="pthread_kill"></a> <a name="tag_03_536"></a><!-- pthread_kill --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright &copy; 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_536_01"></a>NAME</h4><blockquote>pthread_kill - send a signal to a thread</blockquote><h4><a name="tag_03_536_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('THR')">THR</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> #include &lt;<a href="../basedefs/signal.h.html">signal.h</a>&gt;<br><br> int pthread_kill(pthread_t</tt> <i>thread</i><tt>, int</tt> <i>sig</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]"border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_03_536_03"></a>DESCRIPTION</h4><blockquote><p>The <i>pthread_kill</i>() function shall request that a signal be delivered to the specified thread.</p><p>As in <a href="../functions/kill.html"><i>kill</i>()</a>, if <i>sig</i> is zero, error checking shall be performed but no signalshall actually be sent.</p></blockquote><h4><a name="tag_03_536_04"></a>RETURN VALUE</h4><blockquote><p>Upon successful completion, the function shall return a value of zero. Otherwise, the function shall return an error number. Ifthe <i>pthread_kill</i>() function fails, no signal shall be sent.</p></blockquote><h4><a name="tag_03_536_05"></a>ERRORS</h4><blockquote><p>The <i>pthread_kill</i>() function shall fail if:</p><dl compact><dt>[ESRCH]</dt><dd>No thread could be found corresponding to that specified by the given thread ID.</dd><dt>[EINVAL]</dt><dd>The value of the <i>sig</i> argument is an invalid or unsupported signal number.</dd></dl><p>The <i>pthread_kill</i>() function shall not return an error code of [EINTR].</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_536_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_536_07"></a>APPLICATION USAGE</h4><blockquote><p>The <i>pthread_kill</i>() function provides a mechanism for asynchronously directing a signal at a thread in the callingprocess. This could be used, for example, by one thread to affect broadcast delivery of a signal to a set of threads.</p><p>Note that <i>pthread_kill</i>() only causes the signal to be handled in the context of the given thread; the signal action(termination or stopping) affects the process as a whole.</p></blockquote><h4><a name="tag_03_536_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_536_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_536_10"></a>SEE ALSO</h4><blockquote><p><a href="kill.html"><i>kill</i>()</a> , <a href="pthread_self.html"><i>pthread_self</i>()</a> , <a href="raise.html"><i>raise</i>()</a> , the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/signal.h.html"><i>&lt;signal.h&gt;</i></a></p></blockquote><h4><a name="tag_03_536_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 5. Included for alignment with the POSIX Threads Extension.</p></blockquote><h4><a name="tag_03_536_12"></a>Issue 6</h4><blockquote><p>The <i>pthread_kill</i>() function is marked as part of the Threads option.</p><p>The APPLICATION USAGE section is added.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX &reg; is a registered Trademark of The Open Group.<br>POSIX &reg; is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?