pthread_join.html
来自「unix 下的C开发手册,还用详细的例程。」· HTML 代码 · 共 109 行
HTML
109 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>pthread_join</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_007_1378"> </a>NAME</h4><blockquote>pthread_join - wait for thread termination</blockquote><h4><a name = "tag_000_007_1379"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="pthread.h.html">pthread.h</a>>int pthread_join(pthread_t <i>thread</i>, void **<i>value_ptr</i>);</code></pre></blockquote><h4><a name = "tag_000_007_1380"> </a>DESCRIPTION</h4><blockquote>The<i>pthread_join()</i>function suspends execution of the calling thread until the target<i>thread</i>terminates, unless the target<i>thread</i>has already terminated.On return from a successful<i>pthread_join()</i>call with a non-NULL<i>value_ptr</i>argument, the value passed to<i><a href="pthread_exit.html">pthread_exit()</a></i>by the terminating thread is made available in the location referenced by<i>value_ptr</i>.When a<i>pthread_join()</i>returns successfully, the target thread has been terminated.The results of multiple simultaneous calls to<i>pthread_join()</i>specifying the same target thread are undefined.If the thread calling<i>pthread_join()</i>is canceled, then the target thread will not be detached.<p>It is unspecified whether a thread that has exited but remains unjoinedcounts against _POSIX_THREAD_THREADS_MAX.</blockquote><h4><a name = "tag_000_007_1381"> </a>RETURN VALUE</h4><blockquote>If successful, the<i>pthread_join()</i>function returns zero.Otherwise, an error number is returned to indicate the error.</blockquote><h4><a name = "tag_000_007_1382"> </a>ERRORS</h4><blockquote>The <i>pthread_join()</i>function will fail if:<dl compact><dt>[EINVAL]<dd>The implementation has detected that the value specified by<i>thread</i>does not refer to a joinable thread.<dt>[ESRCH]<dd>No thread could be found corresponding to that specifiedby the given thread ID.</dl><p>The<i>pthread_join()</i>function may fail if:<dl compact><dt>[EDEADLK]<dd>A deadlock was detected orthe value of<i>thread</i>specifies the calling thread.</dl><p>The<i>pthread_join()</i>function will not return an error code of [EINTR].</blockquote><h4><a name = "tag_000_007_1383"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1384"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1385"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1386"> </a>SEE ALSO</h4><blockquote><i><a href="pthread_create.html">pthread_create()</a></i>,<i><a href="wait.html">wait()</a></i>,<i><a href="pthread.h.html"><pthread.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from the POSIX Threads Extension (1003.1c-1995)</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 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 + =
减小字号Ctrl + -
显示快捷键?