![]() |
ezEngine Release 25.08
|
Implementation of a thread. More...
#include <OSThread.h>
Public Member Functions | |
ezOSThread (ezOSThreadEntryPoint threadEntryPoint, void *pUserData=nullptr, ezStringView sName="ezOSThread", ezUInt32 uiStackSize=128 *1024) | |
Initializes the thread instance (e.g. thread creation etc.) | |
virtual | ~ezOSThread () |
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 ezThreadID & | GetThreadID () const |
Returns the thread ID of the thread object, may be used in comparison operations with ezThreadUtils::GetCurrentThreadID() for example. | |
Static Public Member Functions | |
static ezInt32 | GetThreadCount () |
Returns how many ezOSThreads are currently active. | |
Protected Attributes | |
ezThreadHandle | m_hHandle |
ezThreadID | m_ThreadID |
ezOSThreadEntryPoint | m_EntryPoint |
void * | m_pUserData |
ezString | m_sName |
ezUInt32 | m_uiStackSize |
Implementation of a thread.
Since the thread class needs a platform specific entry-point it is usually recommended to use the ezThread class instead as the base for long running threads.
ezOSThread::ezOSThread | ( | ezOSThreadEntryPoint | threadEntryPoint, |
void * | pUserData = nullptr , |
||
ezStringView | sName = "ezOSThread" , |
||
ezUInt32 | uiStackSize = 128 * 1024 |
||
) |
void ezOSThread::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)