ThreadManager Class Reference

#include <thread.h>

List of all members.

Static Public Member Functions

static bool isCurrentThread (U32 threadId)
 Returns true if threadId is the same as the calling thread's id.
static bool compare (U32 threadId_1, U32 threadId_2)
 Returns true if the 2 thread ids represent the same thread.
static U32 getCurrentThreadId ()
 Returns the platform specific thread id of the calling thread.
static void addThread (Thread *thread)
 Each thread should add itself to the thread pool the first time it runs.
static void removeThread (Thread *thread)
static ThreadgetThreadById (U32 threadid)
 Searches the pool of known threads for a thread whose id is equivalent to the given threadid.
static ThreadgetCurrentThread ()

Static Private Member Functions

static ThreadManagersingleton ()

Private Attributes

Vector< Thread * > threadPool
Mutex poolLock


Member Function Documentation

static ThreadManager* ThreadManager::singleton (  )  [inline, static, private]

bool ThreadManager::isCurrentThread ( U32  threadId  )  [inline, static]

Returns true if threadId is the same as the calling thread's id.

static bool ThreadManager::compare ( U32  threadId_1,
U32  threadId_2 
) [static]

Returns true if the 2 thread ids represent the same thread.

Some thread APIs return an opaque object as a thread id, so the == operator cannot reliably compare thread ids.

static U32 ThreadManager::getCurrentThreadId (  )  [static]

Returns the platform specific thread id of the calling thread.

Some platforms do not guarantee that this ID stays the same over the life of the thread, so use ThreadManager::compare() to compare thread ids.

static void ThreadManager::addThread ( Thread thread  )  [inline, static]

Each thread should add itself to the thread pool the first time it runs.

static void ThreadManager::removeThread ( Thread thread  )  [inline, static]

static Thread* ThreadManager::getThreadById ( U32  threadid  )  [inline, static]

Searches the pool of known threads for a thread whose id is equivalent to the given threadid.

Compares thread ids with ThreadManager::compare().

static Thread* ThreadManager::getCurrentThread (  )  [inline, static]


Member Data Documentation