PixelLightAPI
.
|
#include <Thread.h>
Public Types | |
enum | EPriorityClass { IdlePriorityClass, BelowNormalPriorityClass, NormalPriorityClass, AboveNormalPriorityClass, HighPriorityClass, RealtimePriorityClass } |
Thread priority class. More... | |
enum | EPriority { IdlePriority, LowestPriority, BelowNormalPriority, NormalPriority, AboveNormalPriority, HighestPriority, TimeCriticalPriority } |
Thread priority within the priority class it is in. More... | |
Public Member Functions | |
PLCORE_API | Thread () |
Constructor. | |
PLCORE_API | Thread (ThreadFunction *pThreadFunction) |
Constructor. | |
PLCORE_API | Thread (THREADFUNCTION pThreadFunction, void *pData) |
Constructor. | |
PLCORE_API | Thread (handle nThreadID) |
Constructor. | |
virtual PLCORE_API | ~Thread () |
Destructor. | |
String | GetName () const |
Returns the name of the thread. | |
void | SetName (const String &sName) |
Sets the name of the thread. | |
handle | GetID () const |
Returns the unique system ID of the thread. | |
bool | IsActive () const |
Returns whether the thread is active. | |
bool | Start () |
Starts the execution of the thread. | |
bool | Terminate () |
Stops the execution of the thread. | |
bool | Join () |
Waits until the thread has been stopped. | |
bool | Join (uint64 nTimeout) |
Waits until the thread has been stopped. | |
EPriorityClass | GetPriorityClass () const |
Returns the priority class the thread is in. | |
bool | SetPriorityClass (EPriorityClass nPriorityClass=NormalPriorityClass) |
Sets the priority class the thread is in. | |
EPriority | GetPriority () const |
Returns the thread priority within the priority class it is in. | |
bool | SetPriority (EPriority nPriority=NormalPriority) |
Sets the thread priority within the priority class it is in. | |
virtual PLCORE_API int | Run () override |
Function to be executed. |
Thread class.
Thread priority class.
Thread priority within the priority class it is in.
IdlePriority |
Idle priority |
LowestPriority |
Lowest priority |
BelowNormalPriority |
Below normal priority |
NormalPriority |
Normal priority (default) |
AboveNormalPriority |
Above normal priority |
HighestPriority |
Highest priority |
TimeCriticalPriority |
Time critical priority |
PLCORE_API PLCore::Thread::Thread | ( | ) |
PLCORE_API PLCore::Thread::Thread | ( | ThreadFunction * | pThreadFunction | ) |
[in] | pThreadFunction | Pointer to the thread function, can be a null pointer |
PLCORE_API PLCore::Thread::Thread | ( | THREADFUNCTION | pThreadFunction, |
void * | pData | ||
) |
[in] | pThreadFunction | Pointer to a static thread function, can be a null pointer |
[in] | pData | Data to be passed to the thread function, can be a null pointer |
PLCORE_API PLCore::Thread::Thread | ( | handle | nThreadID | ) |
[in] | nThreadID | A system specific thread ID, NULL_HANDLE for current thread |
virtual PLCORE_API PLCore::Thread::~Thread | ( | ) | [virtual] |
Destructor.
String PLCore::Thread::GetName | ( | ) | const [inline] |
Returns the name of the thread.
void PLCore::Thread::SetName | ( | const String & | sName | ) | [inline] |
handle PLCore::Thread::GetID | ( | ) | const [inline] |
Returns the unique system ID of the thread.
bool PLCore::Thread::IsActive | ( | ) | const [inline] |
Returns whether the thread is active.
bool PLCore::Thread::Start | ( | ) | [inline] |
Starts the execution of the thread.
bool PLCore::Thread::Terminate | ( | ) | [inline] |
Stops the execution of the thread.
bool PLCore::Thread::Join | ( | ) | [inline] |
Waits until the thread has been stopped.
bool PLCore::Thread::Join | ( | uint64 | nTimeout | ) | [inline] |
Waits until the thread has been stopped.
[in] | nTimeout | Time in milliseconds to wait |
Thread::EPriorityClass PLCore::Thread::GetPriorityClass | ( | ) | const [inline] |
Returns the priority class the thread is in.
bool PLCore::Thread::SetPriorityClass | ( | EPriorityClass | nPriorityClass = NormalPriorityClass | ) | [inline] |
Sets the priority class the thread is in.
[in] | nPriorityClass | New priority class the thread is in |
Thread::EPriority PLCore::Thread::GetPriority | ( | ) | const [inline] |
Returns the thread priority within the priority class it is in.
bool PLCore::Thread::SetPriority | ( | EPriority | nPriority = NormalPriority | ) | [inline] |
Sets the thread priority within the priority class it is in.
[in] | nPriority | New thread priority within the priority class it is in |
virtual PLCORE_API int PLCore::Thread::Run | ( | ) | [override, virtual] |
|