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>OSCheckActiveThreads</title> 10</head> 11 12<body> 13 14<h1>OSCheckActiveThreads</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/os.h> 19 20long OSCheckActiveThreads(void); 21</pre></dd></dl> 22 23<h2>Arguments</h2> 24<p>None.</p> 25 26<h2>Return Values</h2> 27<p>Returns the current number of active threads if the function does not discover any problems. Otherwise, the function stops the program.</p> 28 29<h2>Description</h2> 30<p>The operating system maintains a linked list of all active threads that are runnable, running, waiting, suspended, or moribund. This linked list is called the active thread queue. The <code>OSCheckActiveThreads</code> function disables interrupts and sweeps the active thread queue, performing as many sanity checks as possible. If the <code>OSCheckActiveThreads</code> function finds a broken link or any other problems, it shows a failure message and halts program execution. Because a program error could corrupt the memory space used for thread management, calling this function as an option will help you debug multithreaded programs.</p> 31 32<h2>See Also</h2> 33<P class="reference"> 34<A href="../toc.html#Thread" target="contents">Thread Functions</A><BR><A href="../toc.html#ThreadSynchronization" target="contents">Thread Synchronization Functions</A> 35</p> 36 37<h2>Revision History</h2> 38<P> 392008/09/08 Added "suspended" to possible thread states and standardized "asleep" to "moribund."<br>2006/03/01 Initial version.<br> 40</p> 41 42<hr><p>CONFIDENTIAL</p></body> 43</html>