1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>OS_DestroyThread</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">OS_DestroyThread <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD>
15  <PRE><CODE>#include &lt;nitro/os.h&gt;</CODE></PRE>
16  <PRE><CODE>void OS_DestroyThread( OSThread* thread );</CODE></PRE>
17</DL>
18<H2>Arguments</H2>
19<TABLE border="1">
20  <TBODY>
21    <TR>
22      <TD><B><EM>thread</EM></B></TD>
23      <TD>Ended thread</TD>
24    </TR>
25  </TBODY>
26</TABLE>
27<H2>Return Values</H2>
28<P>None.</P>
29<H2>Description</H2>
30<P>Ends the specified thread. Then switches to another executable thread.</P>
31<P>With <CODE>OS_DestroyThread()</CODE>, a destructor function is not called even if a thread destructor has been preset using <CODE><A href="OS_SetThreadDestructor.html">OS_SetThreadDestructor()</A></CODE>.(The destructor function is called by <CODE><A href="OS_KillThread.html">OS_KillThread*()</A></CODE>.)</P>
32<P>It is also possible to specify the current thread for <EM><B>thread</B></EM>. If this is done, the thread kills itself and switches to the next executable thread. Even in this case, the thread destructor is not called.</P>
33<P>If the mutex for <em>thread</em> is locked, all locked mutex unlock.</P>
34<P>Be cautious when using <CODE>OS_DestroyThread()</CODE>--it suddenly terminates the specified thread <EM><B>thread</B></EM> without any advance warning. If you are going to use this function, be sure you understand the operations of threads.</P>
35<H2>See Also</H2>
36<P><CODE><A href="OS_InitThread.html">OS_InitThread</A>, <A href="OS_ExitThread.html">OS_ExitThread</A>, <A href="OS_KillThread.html">OS_KillThread*</A>, <A href="OS_SetThreadDestructor.html">OS_SetThreadDestructor</A></CODE></P>
37<H2>Revision History</H2>
38<P>2005/07/12 Noted differences with <CODE><A href="OS_KillThread.html">OS_KillThread*()</A></CODE>.<BR> 2004/12/27 Initial version.</P>
39<hr><p>CONFIDENTIAL</p></body>
40</HTML>