1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>OSJoinThread</title>
10</head>
11
12<body>
13
14<h1>OSJoinThread</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">#include &lt;revolution/os.h&gt;
18
19BOOL OSJoinThread(OSThread* thread, void** val);
20</pre></dd></dl>
21
22<h2>Arguments</h2>
23<TABLE class="arguments" border="1" >
24  <tr>
25<TH>thread</TH>
26<TD>Pointer to thread to join.</TD>
27  </tr>
28  <tr>
29<TH>val</TH>
30<TD>Pointer to a void pointer in which the thread's exit value is copied. If the thread was canceled with <code>OSCancelThread</code>, <SPAN class="argument">val</SPAN> will be assigned a value of <CODE>(void*) -1</CODE>. Specify <code>NULL</code> if the thread's exit value is not necessary.</TD>
31  </tr>
32</TABLE>
33
34<h2>Return Values</h2>
35<p>Returns <code>TRUE</code> if the specified thread does not have the <I>detached</I> attribute and has terminated normally. Otherwise, returns <code>FALSE</code>.</p>
36
37<h2>Description</h2>
38<p>As long as the specified thread is not &quot;detached&quot; (see <code>OSDetachThread</code>), the <code>OSJoinThread</code> function will wait for the specified thread to terminate and then generate information regarding the terminated thread.</p>
39
40<p>Multiple threads cannot wait for the same thread to terminate. Only a single thread is guaranteed to return success; all other threads will return <code>FALSE</code>.</p>
41
42<p>This function may put the current thread to sleep. For precautions when calling similar functions, refer to <a href="../Interrupt/intro.html">Interrupts and Callback Functions</a>.</p>
43
44<h2>See Also</h2>
45<P class="reference">
46<A href="../toc.html#Thread" target="contents">Thread Functions</A>,
47<A href="../toc.html#ThreadSynchronization" target="contents">Thread Synchronization Functions</A>,
48<a href="OSCancelThread.html">OSCancelThread</a>,
49<a href="OSDetachThread.html">OSDetachThread</a>,
50<a href="OSExitThread.html">OSExitThread</a>,
51<a href="OSIsThreadTerminated.html">OSIsThreadTerminated</a>,
52<a href="../Interrupt/intro.html">Interrupts and Callback Functions</a>
53</p>
54
55<h2>Revision History</h2>
56<P>
572007/09/25 Added information on the sleeping status of threads.<br>2006/03/01 Initial version.<br>
58</P>
59<hr><p>CONFIDENTIAL</p></body>
60</html>