ThreadManager

Engine/source/platform/threads/thread.h

More...

Classes:

Private Attributes

Private Static Attributes

MainThreadId

Public Functions

Public Static Functions

addThread(Thread * thread)

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

bool
compare(U32 threadId_1, U32 threadId_2)

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

Returns the platform specific thread id of the calling thread.

Returns the platform specific thread id ot the main thread.

getThreadById(U32 threadid)

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

bool
isCurrentThread(U32 threadId)

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

bool

Return true if the caller is running on the main thread.

Detailed Description

Private Attributes

Mutex poolLock 
Vector< Thread * > threadPool 

Private Static Attributes

MainThreadId smMainThreadId 

Public Functions

ThreadManager()

Public Static Functions

addThread(Thread * thread)

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

compare(U32 threadId_1, U32 threadId_2)

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.

getCurrentThread()

getCurrentThreadId()

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.

getMainThreadId()

Returns the platform specific thread id ot the main thread.

getSingletonName()

getThreadById(U32 threadid)

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

Compares thread ids with ThreadManager::compare().

isCurrentThread(U32 threadId)

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

isMainThread()

Return true if the caller is running on the main thread.

removeThread(Thread * thread)