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
17<h2>C Specification</h2>
18
19<dl>
20<dd><pre><code>#include &lt;revolution/os.h&gt;</code></pre>
21  </dd>
22<dd><pre><code>BOOL OSJoinThread (OSThread* thread, void** val);</code></pre>
23  </dd>
24</dl>
25
26<h2>Arguments</h2>
27<TABLE border="1" cellpadding="3" cellspacing="0.1">
28  <tr>
29<TD width="120" bgcolor="#ffffe8"><i><b><code><STRONG><EM><CODE>thread</CODE></EM></STRONG></code></b></i></TD>
30<TD width="520">Pointer to thread to join.</TD>
31    </tr>
32  <tr>
33<TD width="120" bgcolor="#ffffe8"><i><b><code><code><EM><STRONG>val</STRONG></EM></code></code></b></i></TD>
34<TD width="520">Pointer to a void pointer in which the thread's exit value is copied. <STRONG><EM><CODE>val</CODE></EM></STRONG> will be assigned <code>(void*) -1</code> if the thread is canceled using <a     href="OSCancelThread.html"><code>OSCancelThread</code></a>. Specify <code>NULL</code> if the thread's exit value is unnecessary.</TD>
35    </tr>
36</TABLE>
37<h2>Return Values</h2>
38
39<p>Returns <code>TRUE</code> if the specified thread does not have the detached attribute and has ended normally. Otherwise, returns <code>FALSE</code>.</p>
40
41<h2>Description</h2>
42
43<p>If the specified thread does not have the detached attribute (see the <code>OSDetachThread</code> function), the <code>OSJoinThread</code> function will wait until the specified thread ends, and then generate information about the ended thread.</p>
44
45<p>Multiple threads can't wait for the same thread to end. Success is guaranteed for only one thread; <code>FALSE</code> is returned for all other threads. </p>
46
47
48
49<h2>See Also</h2>
50
51<p><A href="../toc.html#Thread" target="contents">Thread Synchronization</A>, <A href="../toc.html#ThreadSynchronization" target="contents">Thread Synchronization Functions</A>, <a href="OSCancelThread.html"><code>OSCancelThread</code></a>,&nbsp; <a href="OSDetachThread.html"><code>OSDetachThread</code></a>,&nbsp; <a href="OSExitThread.html"><code>OSExitThread</code></a>,&nbsp; <a href="OSIsThreadTerminated.html"><code>OSIsThreadTerminated</code></a></p>
52
53<h2>Revision History</h2><p></p>
54
55<P>03/01/2006 Initial version.</p>
56
57</body>
58</html>