OSCheckActiveThreads

Syntax

#include <revolution/os.h>

long OSCheckActiveThreads(void);

Arguments

None.

Return Values

Returns the current number of active threads if the function does not discover any problems. Otherwise, the function stops the program.

Description

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 OSCheckActiveThreads function disables interrupts and sweeps the active thread queue, performing as many sanity checks as possible. If the OSCheckActiveThreads 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.

See Also

Thread Functions
Thread Synchronization Functions

Revision History

2008/09/08 Added "suspended" to possible thread states and standardized "asleep" to "moribund."
2006/03/01 Initial version.


CONFIDENTIAL