⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pthread_setcanceltype.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>pthread_setcancelstate</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_007_1726">&nbsp;</a>NAME</h4><blockquote>pthread_setcancelstate, pthread_setcanceltype, pthread_testcancel- set cancelability state</blockquote><h4><a name = "tag_000_007_1727">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="pthread.h.html">pthread.h</a>&gt;int pthread_setcancelstate(int <i>state</i>, int *<i>oldstate</i>);int pthread_setcanceltype(int <i>type</i>, int *<i>oldtype</i>);void pthread_testcancel(void);</code></pre></blockquote><h4><a name = "tag_000_007_1728">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>pthread_setcancelstate()</i>function atomically both sets the calling thread's cancelabilitystate to the indicated<i>state</i>and returns the previous cancelability stateat the location referenced by <i>oldstate</i>.Legal values for<i>state</i>are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE.<p>The<i>pthread_setcanceltype()</i>function atomically both sets the calling thread's cancelabilitytype to the indicated<i>type</i>and returns the previous cancelability typeat the location referenced by <i>oldtype</i>.Legal values for<i>type</i>are PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS.<p>The cancelability state and type of any newlycreated threads, including the thread in which<i>main()</i>was first invoked,are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERREDrespectively.<p>The<i>pthread_testcancel()</i>function creates a cancellation point in the calling thread.The<i>pthread_testcancel()</i>function has no effect if cancelability is disabled.</blockquote><h4><a name = "tag_000_007_1729">&nbsp;</a>RETURN VALUE</h4><blockquote>If successful, the<i>pthread_setcancelstate()</i>and<i>pthread_setcanceltype()</i>functions return zero.Otherwise, an error number is returned to indicate the error.</blockquote><h4><a name = "tag_000_007_1730">&nbsp;</a>ERRORS</h4><blockquote>The <i>pthread_setcancelstate()</i>function may fail if:<dl compact><dt>[EINVAL]<dd>The specified state is notPTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.</dl><p>The<i>pthread_setcanceltype()</i>function may fail if:<dl compact><dt>[EINVAL]<dd>The specified type is not PTHREAD_CANCEL_DEFERREDor PTHREAD_CANCEL_ASYNCHRONOUS.</dl><p>These functions will not return an error code of [EINTR].</blockquote><h4><a name = "tag_000_007_1731">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1732">&nbsp;</a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1733">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1734">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="pthread_cancel.html">pthread_cancel()</a></i>,<i><a href="pthread.h.html">&lt;pthread.h&gt;</a></i>.<br></blockquote><h4>DERIVATION</h4><blockquote>Derived from the POSIX Threads Extension (1003.1c-1995)</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

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