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>OSCancelThread</title>
10</head>
11
12<body>
13
14<h1>OSCancelThread</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>void OSCancelThread(OSThread* thread);</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>thread</code></b></i></TD>
30      <TD width="520">Pointer to thread to terminate.</TD>
31    </tr>
32</TABLE>
33<h2>Return Values</h2>
34
35<p>None.</p>
36
37<h2>Description</h2>
38
39<p>Stops the specified thread.&nbsp; If suspended on a thread queue, the thread specified by <em><code><strong>thread</strong></code></em> is removed from the queue.&nbsp; All mutexes held by <em><code><strong>thread</strong></code></em> will be released.&nbsp;(All threads waiting to be joined using <code><a href="OSJoinThread.html">OSJoinThread</a></code> will be made executable.)</p>
40
41<p>Any <em><code><strong>thread</strong></code></em> with the &quot;detached&quot; attribute set will be removed from the run queue immediately.</p>
42
43<p>If the &quot;detached&quot; attribute is not set, <em><code><strong>thread</strong></code></em> will be removed from the run queue only when any joined threads start running.</p>
44
45<p><B>Note: </B>If calling the <code>OSCancelThread</code> function while the <code>OSSleepSeconds</code> function is running, call it after calling the <code>OSCancelAlarms</code> function with the <code>OSThread</code> pointer as a tag.</p>
46
47
48<h2>See Also</h2>
49
50<p><A href="../toc.html#Thread" target="contents">Thread Synchronization</A><BR> <A href="../toc.html#ThreadSynchronization" target="contents">Thread Synchronization Functions</A>,<br> <a href="OSCreateThread.html"><code>OSCreateThread</code></a><BR> <a href="OSExitThread.html"><code>OSExitThread</code></a><BR> <a href="OSJoinThread.html"><code>OSJoinThread</code></a><BR> <a href="OSSleepSeconds.html"><code>OSSleepSeconds</code></a><BR> <a href="../Alarm/OSCancelAlarms.html"><code>OSCancelAlarms</code></a></p>
51
52<h2>Revision History</h2><p></p>
53
54<P>2007/12/11 Added notes. <br> 2006/03/01 Initial version.</p>
55
56<hr><p>CONFIDENTIAL</p></body>
57</html>