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 http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<title>Thread state transition</title>
9</head>
10
11<body>
12
13<h1>Thread State Transitions</h1>
14
15<h2>Introduction</h2>
16<P>
17A thread state transition diagram is shown below.
18</P>
19<P>
20<img src="./fig0.png">
21</P>
22<P>
23Note that items such as the prefixes of function names have been omitted in the diagram for simplicity. For example, <CODE>Create()</CODE> in the diagram should be read as <CODE>OSCreateThread()</CODE>.
24</P>
25
26<h2>Functions</h2>
27<P>
28The primary functions that cause transitions in a thread's state are listed below.
29</P>
30<P>
31<dl><dd><pre class="construction">
32void OSYieldThread  ( void );
33BOOL OSCreateThread ( OSThread* thread, void* (*func)(void*), void* param, void* stack, u32 stackSize, OSPriority priority, u16 attr );
34void OSExitThread   ( void* val );
35void OSCancelThread ( OSThread* thread );
36s32  OSResumeThread ( OSThread* thread );
37s32  OSSuspendThread( OSThread* thread );
38void OSSleepThread  ( OSThreadQueue* queue );
39void OSWakeupThread ( OSThreadQueue* queue );
40void OSDetachThread ( OSThread* thread );
41</pre></dd></dl>
42</P>
43
44<h2>See Also</h2>
45<P class="reference">
46<a target="contents" href="../toc.html#Thread">Thread Functions</a>
47</P>
48
49<H2>Revision History</H2>
50<P>
512008/09/08 Updated the transition diagram for threads and added the <CODE>OSDetachThread</CODE> function to functions that cause a state transition.<br>2007/07/30 Initial version.<br>
52</P>
53
54<hr><p>CONFIDENTIAL</p></body>
55</html>
56