![]() |
Plasma Engine
2.0
|
Implementation of a thread. More...
#include <OSThread.h>

Public Member Functions | |
| plOSThread (plOSThreadEntryPoint threadEntryPoint, void *pUserData=nullptr, plStringView sName="plOSThread", plUInt32 uiStackSize=128 *1024) | |
| Initializes the thread instance (e.g. thread creation etc.) | |
| virtual | ~plOSThread () |
| Destructor. | |
| void | Start () |
| Starts the thread. | |
| void | Join () |
| Waits in the calling thread until the thread has finished execution (e.g. returned from the thread function) | |
| const plThreadID & | GetThreadID () const |
| Returns the thread ID of the thread object, may be used in comparison operations with plThreadUtils::GetCurrentThreadID() for example. | |
Static Public Member Functions | |
| static plInt32 | GetThreadCount () |
| Returns how many plOSThreads are currently active. | |
Protected Attributes | |
| plThreadHandle | m_hHandle |
| plThreadID | m_ThreadID |
| plOSThreadEntryPoint | m_EntryPoint |
| void * | m_pUserData |
| plString | m_sName |
| plUInt32 | m_uiStackSize |
Implementation of a thread.
Since the thread class needs a platform specific entry-point it is usually recommended to use the plThread class instead as the base for long running threads.
| plOSThread::plOSThread | ( | plOSThreadEntryPoint | threadEntryPoint, |
| void * | pUserData = nullptr, | ||
| plStringView | sName = "plOSThread", | ||
| plUInt32 | uiStackSize = 128 * 1024 ) |
| void plOSThread::Join | ( | ) |
Waits in the calling thread until the thread has finished execution (e.g. returned from the thread function)
Joins with the thread (waits for termination)