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_InitThread</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">OS_InitThread <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_InitThread( void );</CODE></PRE>
17</DL>
18<H2>Arguments</H2>
19<P>None.</P>
20<H2>Return Values</H2>
21<P>None.</P>
22<H2>Description</H2>
23<P>Initializes the thread library. <BR> When you are using a thread system, this function must be called once (and only once) before you create threads. This function is called internally by the <CODE><A href="../init/OS_Init.html">OS_Init</A></CODE> function, so there is normally no need for the application to call it again.</P>
24<P>By calling this function, the application itself will be treated as a thread started from the <code>NitroMain</code> function with a <font color="#ff0000">priority of 16</font>. (This is called the &quot;launcher thread&quot; in the function reference manual and in various other documentation.) DTCM is normally used for this thread's stack. </P>
25<P>An idle thread is created when the thread system is initialized. This is a special thread with a <font color="#ff0033">priority of 32</font>, a lower priority than any other thread. The user can set all other threads to a priority in the range 0-31. The idle thread does nothing and loops in Halt status.</P>
26<H2>See Also</H2>
27<P><a href="OS_CreateThread.html"><CODE>OS_CreateThread</CODE></a><BR> <a href="OS_ExitThread.html"><CODE>OS_ExitThread</CODE></a><BR> <a href="OS_WakeupThread.html"><CODE>OS_WakeupThread</CODE></a><BR> <a href="OS_WakeupThreadDirect.html"><CODE>OS_WakeupThreadDirect</CODE></a></P>
28<H2>Revision History</H2>
29<P>
302009/05/19 Explained that this function is called internally by <CODE>OS_Init</CODE>.<BR> 2005/04/11 Corrected the description of application state after calling and added a note about launcher threads.<br /> 2004/04/27 Added a description of the idle thread.<br /> 2004/02/26 Added a description of the priority of the starting thread.<br />2003/12/01 Initial version.</P>
31<hr><p>CONFIDENTIAL</p></body>
32</HTML>